Compare commits
39 Commits
sdl2_ogles
...
RCBasic4-A
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9275b7d80 | ||
|
|
f35b940637 | ||
|
|
cf47eb2039 | ||
|
|
c085150def | ||
|
|
378c25ffde | ||
|
|
40ca65cb3f | ||
|
|
3f4a1ce1cc | ||
|
|
fc082973d2 | ||
|
|
a8c3f059cc | ||
|
|
89258b691d | ||
|
|
3972f8b927 | ||
|
|
5719ad1dbd | ||
|
|
0b132399fc | ||
|
|
79ec4b5ae0 | ||
|
|
c506ea110c | ||
|
|
bac4a2734f | ||
|
|
5ff184aff6 | ||
|
|
ca2c818b25 | ||
|
|
229aebfec3 | ||
|
|
9e61ea1c5e | ||
|
|
78e3281bf3 | ||
|
|
cf6feab5c1 | ||
|
|
5221ac5e8f | ||
|
|
3e2b01d794 | ||
|
|
b4b18b4860 | ||
|
|
8fd6acbde3 | ||
|
|
a0b3025848 | ||
|
|
fe5b5bc389 | ||
|
|
ceee3fc5d0 | ||
|
|
34c023a976 | ||
|
|
74f9fc8969 | ||
|
|
a13d3de54f | ||
|
|
19f67fa883 | ||
|
|
f8296f44cf | ||
|
|
f30aaffc4c | ||
|
|
1e47d69e23 | ||
|
|
5c53e7067b | ||
|
|
de0101253d | ||
|
|
cbb578981a |
@@ -9,7 +9,42 @@
|
|||||||
<body>
|
<body>
|
||||||
<p><h2>function CreateSprite( img ) </h2></p>
|
<p><h2>function CreateSprite( img ) </h2></p>
|
||||||
<p>
|
<p>
|
||||||
Returns new sprite
|
This function returns a new sprite which you can place in a variable for use in your program.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Here is an example of opening a sprite canvas layer, creating a sprite, setting it's position and finally displaying it.
|
||||||
|
</p>
|
||||||
|
<p id="rc_code"><code>
|
||||||
|
isFullScreen = <span class="rc_keyword">false</span> <br>
|
||||||
|
vSync = <span class="rc_keyword">true</span> <br>
|
||||||
|
winWidth = <span class="rc_number">640</span> <br>
|
||||||
|
winHeight = <span class="rc_number">480</span> <br>
|
||||||
|
canViewPortX = <span class="rc_number">0</span> <br>
|
||||||
|
canViewPortY = <span class="rc_number">0</span> <br>
|
||||||
|
<br>
|
||||||
|
OpenWindow<b>(</b><span class="rc_string">"CreateSprite"</span>, winWidth, winHeight, isFullScreen, vSync<b>)</b> <br>
|
||||||
|
sCanvas = OpenCanvasSpriteLayer<b>(</b>canViewPortX, canViewPortY, winWidth, winHeight<b>)</b> <br>
|
||||||
|
Canvas<b>(</b>sCanvas<b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_keyword">DIM</span> eye <br>
|
||||||
|
<span class="rc_keyword">DIM</span> eyeW <br>
|
||||||
|
<span class="rc_keyword">DIM</span> eyeH <br>
|
||||||
|
<br>
|
||||||
|
eye = LoadImage<b>(</b><span class="rc_string">"theEye.png"</span><b>)</b> <br>
|
||||||
|
GetImageSize<b>(</b>eye, eyeW, eyeH<b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
eyeSprite = CreateSprite<b>(</b>eye, eyeW, eyeH<b>)</b> <br>
|
||||||
|
SetSpritePosition<b>(</b>eyeSprite, <span class="rc_number">100</span>, <span class="rc_number">100</span><b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_keyword">While</span> <span class="rc_keyword">Not</span> Key<b>(</b>K_ESCAPE<b>)</b> <br>
|
||||||
|
<span class="rc_comment">'ClearCanvas() For a sprite layer canvas, you don't need to call ClearCanvas. It's automatically called. </span><br>
|
||||||
|
Update<b>(</b><b>)</b> <span class="rc_comment">'Update automatically deals with drawing the sprites on the sprite canvas. </span><br>
|
||||||
|
<span class="rc_keyword">Wend</span> <br>
|
||||||
|
</code></p>
|
||||||
|
<p><img src="images/theEye.png" ></p>
|
||||||
|
<br><p>Related:
|
||||||
|
<a href="opencanvasspritelayer.html">OpenCanvasSpriteLayer</a>
|
||||||
|
<a href="setspriteposition.html">SetSpritePosition</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,67 @@
|
|||||||
tile_h - The height of each tile
|
tile_h - The height of each tile
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p id="rc_code"><code>
|
||||||
|
isFullScreen = <span class="rc_keyword">false</span> <br>
|
||||||
|
vSync = <span class="rc_keyword">true</span> <br>
|
||||||
|
winWidth = <span class="rc_number">640</span> <br>
|
||||||
|
winHeight = <span class="rc_number">480</span> <br>
|
||||||
|
canViewPortX = <span class="rc_number">0</span> <br>
|
||||||
|
canViewPortY = <span class="rc_number">0</span> <br>
|
||||||
|
<br>
|
||||||
|
OpenWindow<b>(</b><span class="rc_string">"TestTileset"</span>, winWidth, winHeight, isFullScreen, vSync<b>)</b> <br>
|
||||||
|
mCanvas = OpenCanvas<b>(</b>winWidth, winHeight, canViewPortX, canViewPortY, winWidth, winHeight, <span class="rc_number">1</span><b>)</b> <br>
|
||||||
|
Canvas<b>(</b>mCanvas<b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
mAtlas = LoadImage<b>(</b><span class="rc_string">"testTileSet.png"</span><b>)</b> <span class="rc_comment">'Load in our atlas or tile set image </span><br>
|
||||||
|
<br>
|
||||||
|
mTileSet = CreateTileSet<b>(</b>mAtlas, <span class="rc_number">24</span>, <span class="rc_number">24</span><b>)</b> <span class="rc_comment">'Create a tile set and assign it a holder to access </span><br>
|
||||||
|
<br>
|
||||||
|
mTileMap = CreateTileMap<b>(</b>mTileSet, <span class="rc_number">20</span>, <span class="rc_number">20</span><b>)</b> <span class="rc_comment">'Create a tile map with our tile set holder "mTileSet" </span><br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_comment">'Now we have a blacnk tilemap to fill with tiles, we now use the mAtlas image to fill in the map </span><br>
|
||||||
|
<span class="rc_comment">'First we will assign a grass tile across our entire tile map. lets grab a grass tile to fill in. </span><br>
|
||||||
|
<br>
|
||||||
|
FillTile<b>(</b>mTileMap, <span class="rc_number">166</span>, <span class="rc_number">0</span>, <span class="rc_number">0</span>, <span class="rc_number">20</span>, <span class="rc_number">20</span><b>)</b> <span class="rc_comment">'The tile number goes by starting at the top left corner to the right edge of the image, </span><br>
|
||||||
|
<span class="rc_comment">'then wraps around and comntinues the count, the image is 13 wide (0-12) so 166 would be </span><br>
|
||||||
|
<span class="rc_comment">'2 in from the end of the last row of images on the tileset. </span><br>
|
||||||
|
<br>
|
||||||
|
SetTile<b>(</b>mTileMap, <span class="rc_number">15</span>, <span class="rc_number">0</span>, <span class="rc_number">0</span><b>)</b> <span class="rc_comment">'With the map filled with grass tiles we can change a single tile, to a little guy in the </span><br>
|
||||||
|
<span class="rc_comment">'top left corner. </span><br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_comment">'Before we begin our main loop, we need to make some variables for holding some important info </span><br>
|
||||||
|
mOffsetX = <span class="rc_number">0</span> <br>
|
||||||
|
mOffsetY = <span class="rc_number">0</span> <span class="rc_comment">'Offset values for where the tile is to be drawn from, used for scrolling. </span><br>
|
||||||
|
mViewportX = <span class="rc_number">640</span> <br>
|
||||||
|
mViewportY = <span class="rc_number">480</span> <span class="rc_comment">'How much of the tile map is to be drawn on the canvas </span><br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_keyword">While</span> <span class="rc_keyword">Not</span> Key<b>(</b>K_ESCAPE<b>)</b> <br>
|
||||||
|
ClearCanvas<b>(</b><b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
DrawTileMap<b>(</b>mTileMap, <span class="rc_number">0</span>, <span class="rc_number">0</span>, mViewportX, mViewportY, mOffsetX, mOffsetY<b>)</b> <br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_keyword">If</span> Key<b>(</b>K_UP<b>)</b> <span class="rc_keyword">Then</span> <br>
|
||||||
|
mOffsetY = mOffsetY - <span class="rc_number">0.5</span> <br>
|
||||||
|
<span class="rc_keyword">ElseIf</span> Key<b>(</b>K_DOWN<b>)</b> <span class="rc_keyword">Then</span> <br>
|
||||||
|
mOffsetY = mOffsetY + <span class="rc_number">0.5</span> <br>
|
||||||
|
<span class="rc_keyword">ElseIf</span> Key<b>(</b>K_LEFT<b>)</b> <span class="rc_keyword">Then</span> <br>
|
||||||
|
mOffsetX = mOffsetX - <span class="rc_number">0.5</span> <br>
|
||||||
|
<span class="rc_keyword">ElseIf</span> Key<b>(</b>K_RIGHT<b>)</b> <span class="rc_keyword">Then</span> <br>
|
||||||
|
mOffsetX = mOffsetX + <span class="rc_number">0.5</span> <br>
|
||||||
|
<span class="rc_keyword">End</span> <span class="rc_keyword">If</span> <br>
|
||||||
|
<br>
|
||||||
|
Update<b>(</b><b>)</b> <br>
|
||||||
|
<span class="rc_keyword">Wend</span> <br>
|
||||||
|
<br>
|
||||||
|
<span class="rc_comment">'As you can see this replaces the grass tile with a character tile, if we wanted to place the character or any other object or image ontop of the tile </span><br>
|
||||||
|
<span class="rc_comment">'we would DrawImage() an image not using the tilemap. </span><br>
|
||||||
|
</code></p>
|
||||||
|
<p><img src="images/testTileSet.png" ></p>
|
||||||
<br><p>Related:
|
<br><p>Related:
|
||||||
<a href="createtilemap.html">CreateTileMap</a>
|
<a href="createtilemap.html">CreateTileMap</a>
|
||||||
|
<a href="settile.html">SetTile</a>
|
||||||
|
<a href="filltile.html">FillTile</a>
|
||||||
|
<a href="drawtilemap.html">DrawTileMap</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
|||||||
20
doc/doc_files/getgravity2d.html
Normal file
20
doc/doc_files/getgravity2d.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||||
|
<title>GetGravity2D [RCBasic Doc] </title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p><h2>sub GetGravity2D(ByRef x, ByRef y) </h2></p>
|
||||||
|
<p>
|
||||||
|
Use this function for retrieving the global gravity vector. A sprite canvas layer must be open.
|
||||||
|
</p>
|
||||||
|
<br><p>Related:
|
||||||
|
<a href="setgravity2d.html">SetGravity2D</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
doc/doc_files/images/testTileSet.png
Normal file
BIN
doc/doc_files/images/testTileSet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 212 KiB |
BIN
doc/doc_files/images/theEye.png
Normal file
BIN
doc/doc_files/images/theEye.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 888 B |
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<p><h2>function OpenCanvasSpriteLayer(w, h, viewport_x, viewport_y, viewport_w, viewport_h) </h2></p>
|
<p><h2>function OpenCanvasSpriteLayer(viewport_x, viewport_y, viewport_w, viewport_h) </h2></p>
|
||||||
<p>
|
<p>
|
||||||
Returns a sprite layer. These canvases are used for rendering sprites with the integrated physics engine.
|
Returns a sprite layer. These canvases are used for rendering sprites with the integrated physics engine.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
20
doc/doc_files/setgravity2d.html
Normal file
20
doc/doc_files/setgravity2d.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||||
|
<title>SetGravity2D [RCBasic Doc] </title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p><h2>sub SetGravity2D(x, y) </h2></p>
|
||||||
|
<p>
|
||||||
|
Use this function for setting the global gravity vector. A sprite canvas layer must be active.
|
||||||
|
</p>
|
||||||
|
<br><p>Related:
|
||||||
|
<a href="getgravity2d.html">GetGravity2D</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,4 +1,38 @@
|
|||||||
#title CreateSprite [RCBasic Doc]
|
#title CreateSprite [RCBasic Doc]
|
||||||
#header function CreateSprite( img )
|
#header function CreateSprite( img )
|
||||||
|
|
||||||
Returns new sprite
|
This function returns a new sprite which you can place in a variable for use in your program.
|
||||||
|
|
||||||
|
Here is an example of opening a sprite canvas layer, creating a sprite, setting it's position and finally displaying it.
|
||||||
|
|
||||||
|
#code
|
||||||
|
isFullScreen = false
|
||||||
|
vSync = true
|
||||||
|
winWidth = 640
|
||||||
|
winHeight = 480
|
||||||
|
canViewPortX = 0
|
||||||
|
canViewPortY = 0
|
||||||
|
|
||||||
|
OpenWindow("CreateSprite", winWidth, winHeight, isFullScreen, vSync)
|
||||||
|
sCanvas = OpenCanvasSpriteLayer(canViewPortX, canViewPortY, winWidth, winHeight)
|
||||||
|
Canvas(sCanvas)
|
||||||
|
|
||||||
|
DIM eye
|
||||||
|
DIM eyeW
|
||||||
|
DIM eyeH
|
||||||
|
|
||||||
|
eye = LoadImage("theEye.png")
|
||||||
|
GetImageSize(eye, eyeW, eyeH)
|
||||||
|
|
||||||
|
eyeSprite = CreateSprite(eye, eyeW, eyeH)
|
||||||
|
SetSpritePosition(eyeSprite, 100, 100)
|
||||||
|
|
||||||
|
While Not Key(K_ESCAPE)
|
||||||
|
'ClearCanvas() For a sprite layer canvas, you don't need to call ClearCanvas. It's automatically called.
|
||||||
|
Update() 'Update automatically deals with drawing the sprites on the sprite canvas.
|
||||||
|
Wend
|
||||||
|
#/code
|
||||||
|
|
||||||
|
#image "images/theEye.png"
|
||||||
|
|
||||||
|
#ref OpenCanvasSpriteLayer SetSpritePosition
|
||||||
|
|||||||
@@ -10,4 +10,62 @@ Parameters:
|
|||||||
#li tile_h - The height of each tile
|
#li tile_h - The height of each tile
|
||||||
#/list
|
#/list
|
||||||
|
|
||||||
#ref CreateTileMap
|
#code
|
||||||
|
isFullScreen = false
|
||||||
|
vSync = true
|
||||||
|
winWidth = 640
|
||||||
|
winHeight = 480
|
||||||
|
canViewPortX = 0
|
||||||
|
canViewPortY = 0
|
||||||
|
|
||||||
|
OpenWindow("TestTileset", winWidth, winHeight, isFullScreen, vSync)
|
||||||
|
mCanvas = OpenCanvas(winWidth, winHeight, canViewPortX, canViewPortY, winWidth, winHeight, 1)
|
||||||
|
Canvas(mCanvas)
|
||||||
|
|
||||||
|
mAtlas = LoadImage("testTileSet.png") 'Load in our atlas or tile set image
|
||||||
|
|
||||||
|
mTileSet = CreateTileSet(mAtlas, 24, 24) 'Create a tile set and assign it a holder to access
|
||||||
|
|
||||||
|
mTileMap = CreateTileMap(mTileSet, 20, 20) 'Create a tile map with our tile set holder "mTileSet"
|
||||||
|
|
||||||
|
'Now we have a blacnk tilemap to fill with tiles, we now use the mAtlas image to fill in the map
|
||||||
|
'First we will assign a grass tile across our entire tile map. lets grab a grass tile to fill in.
|
||||||
|
|
||||||
|
FillTile(mTileMap, 166, 0, 0, 20, 20) 'The tile number goes by starting at the top left corner to the right edge of the image,
|
||||||
|
'then wraps around and comntinues the count, the image is 13 wide (0-12) so 166 would be
|
||||||
|
'2 in from the end of the last row of images on the tileset.
|
||||||
|
|
||||||
|
SetTile(mTileMap, 15, 0, 0) 'With the map filled with grass tiles we can change a single tile, to a little guy in the
|
||||||
|
'top left corner.
|
||||||
|
|
||||||
|
'Before we begin our main loop, we need to make some variables for holding some important info
|
||||||
|
mOffsetX = 0
|
||||||
|
mOffsetY = 0 'Offset values for where the tile is to be drawn from, used for scrolling.
|
||||||
|
mViewportX = 640
|
||||||
|
mViewportY = 480 'How much of the tile map is to be drawn on the canvas
|
||||||
|
|
||||||
|
While Not Key(K_ESCAPE)
|
||||||
|
ClearCanvas()
|
||||||
|
|
||||||
|
DrawTileMap(mTileMap, 0, 0, mViewportX, mViewportY, mOffsetX, mOffsetY)
|
||||||
|
|
||||||
|
If Key(K_UP) Then
|
||||||
|
mOffsetY = mOffsetY - 0.5
|
||||||
|
ElseIf Key(K_DOWN) Then
|
||||||
|
mOffsetY = mOffsetY + 0.5
|
||||||
|
ElseIf Key(K_LEFT) Then
|
||||||
|
mOffsetX = mOffsetX - 0.5
|
||||||
|
ElseIf Key(K_RIGHT) Then
|
||||||
|
mOffsetX = mOffsetX + 0.5
|
||||||
|
End If
|
||||||
|
|
||||||
|
Update()
|
||||||
|
Wend
|
||||||
|
|
||||||
|
'As you can see this replaces the grass tile with a character tile, if we wanted to place the character or any other object or image ontop of the tile
|
||||||
|
'we would DrawImage() an image not using the tilemap.
|
||||||
|
#/code
|
||||||
|
|
||||||
|
#image "images/testTileSet.png"
|
||||||
|
|
||||||
|
#ref CreateTileMap SetTile FillTile DrawTileMap
|
||||||
|
|||||||
6
doc/files/deletejoint.txt
Normal file
6
doc/files/deletejoint.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title DeleteJoint [RCBasic Doc]
|
||||||
|
#header Sub DeleteJoint( joint_id )
|
||||||
|
|
||||||
|
Clears a joint from memory
|
||||||
|
|
||||||
|
#ref CreateDistanceJoint CreateFrictionJoint CreateGearJoint CreateMotorJoint CreatePrismaticJoint CreatePulleyJoint CreateRevoluteJoint CreateWeldJoint CreateWheelJoint
|
||||||
6
doc/files/getgravity2d.txt
Normal file
6
doc/files/getgravity2d.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetGravity2D [RCBasic Doc]
|
||||||
|
#header sub GetGravity2D(ByRef x, ByRef y)
|
||||||
|
|
||||||
|
Use this function for retrieving the global gravity vector. A sprite canvas layer must be open.
|
||||||
|
|
||||||
|
#ref SetGravity2D
|
||||||
4
doc/files/getspriteaabb.txt
Normal file
4
doc/files/getspriteaabb.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#title GetSpriteAABB [RCBasic Doc]
|
||||||
|
#header sub GetSpriteAABB( spr_id, ByRef x1, ByRef y1, ByRef x2, ByRef y2 )
|
||||||
|
|
||||||
|
Returns the axis aligned bounding box for a sprite
|
||||||
6
doc/files/getspritedensity.txt
Normal file
6
doc/files/getspritedensity.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetSpriteDensity [RCBasic Doc]
|
||||||
|
#header function GetSpriteDensity( spr_id )
|
||||||
|
|
||||||
|
Returns the density of a sprite. Higher density means a heavier sprite.
|
||||||
|
|
||||||
|
#ref SetSpriteDensity
|
||||||
7
doc/files/getspritefriction.txt
Normal file
7
doc/files/getspritefriction.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#title GetSpriteFriction [RCBasic Doc]
|
||||||
|
#header function GetSpriteFriction( spr_id )
|
||||||
|
|
||||||
|
Returns a sprite's friction
|
||||||
|
|
||||||
|
#ref GetSpriteFriction
|
||||||
|
|
||||||
6
doc/files/getspriterestitution.txt
Normal file
6
doc/files/getspriterestitution.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetSpriteRestitution [RCBasic Doc]
|
||||||
|
#header function GetSpriteRestitution( spr_id )
|
||||||
|
|
||||||
|
Returns the restitution coefficient for a sprite
|
||||||
|
|
||||||
|
#ref SetSpriteRestitution
|
||||||
6
doc/files/getspriterestitutionthreshold.txt
Normal file
6
doc/files/getspriterestitutionthreshold.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetSpriteRestitutionThreshold [RCBasic Doc]
|
||||||
|
#header function GetSpriteRestitutionThreshold( spr_id )
|
||||||
|
|
||||||
|
Returns the restitution velocity threshold for a sprite
|
||||||
|
|
||||||
|
#ref SetSpriteRestitutionThreshold
|
||||||
6
doc/files/getworld2dautoclearforces.txt
Normal file
6
doc/files/getworld2dautoclearforces.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetWorld2DAutoClearForces [RCBasic Doc]
|
||||||
|
#header function GetWorld2DAutoClearForces()
|
||||||
|
|
||||||
|
Returns the auto clear forces flag for the active canvas
|
||||||
|
|
||||||
|
#ref SetWorld2DAutoClearForces
|
||||||
7
doc/files/getworld2dpositioniterations.txt
Normal file
7
doc/files/getworld2dpositioniterations.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#title GetWorld2DPositionIterations [RCBasic Doc]
|
||||||
|
#header function GetWorld2DPositionIterations()
|
||||||
|
|
||||||
|
Returns the number of position iterations for the position constraint solver
|
||||||
|
|
||||||
|
#ref SetWorld2DPositionIterations
|
||||||
|
|
||||||
6
doc/files/getworld2dtimestep.txt
Normal file
6
doc/files/getworld2dtimestep.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetWorld2DTimeStep [RCBasic Doc]
|
||||||
|
#header function GetWorld2DTimeStep()
|
||||||
|
|
||||||
|
Returns the timestep for the active canvas
|
||||||
|
|
||||||
|
#ref SetWorld2DTimeStep
|
||||||
6
doc/files/getworld2dvelocityiterations.txt
Normal file
6
doc/files/getworld2dvelocityiterations.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title GetWorld2DVelocityIterations [RCBasic Doc]
|
||||||
|
#header function GetWorld2DVelocityIterations()
|
||||||
|
|
||||||
|
Returns the number of velocity iterations for the velocity constraint solver
|
||||||
|
|
||||||
|
#ref SetWorld2DVelocityIterations
|
||||||
5
doc/files/getworld3dmaxsubsteps.txt
Normal file
5
doc/files/getworld3dmaxsubsteps.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#title GetWorld3DMaxSubSteps [RCBasic Doc]
|
||||||
|
#header function GetWorld3DMaxSubSteps()
|
||||||
|
|
||||||
|
Returns the maximum substeps in the 3d physics time step
|
||||||
|
|
||||||
4
doc/files/getworld3dtimestep.txt
Normal file
4
doc/files/getworld3dtimestep.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#title GetWorld3DTimeStep [RCBasic Doc]
|
||||||
|
#header function GetWorld3DTimeStep()
|
||||||
|
|
||||||
|
Returns the timestep of the 3d physics simulation
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#title OpenCanvasSpriteLayer [RCBasic Doc]
|
#title OpenCanvasSpriteLayer [RCBasic Doc]
|
||||||
#header function OpenCanvasSpriteLayer(w, h, viewport_x, viewport_y, viewport_w, viewport_h)
|
#header function OpenCanvasSpriteLayer(viewport_x, viewport_y, viewport_w, viewport_h)
|
||||||
|
|
||||||
Returns a sprite layer. These canvases are used for rendering sprites with the integrated physics engine.
|
Returns a sprite layer. These canvases are used for rendering sprites with the integrated physics engine.
|
||||||
|
|
||||||
|
|||||||
6
doc/files/setgravity2d.txt
Normal file
6
doc/files/setgravity2d.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetGravity2D [RCBasic Doc]
|
||||||
|
#header sub SetGravity2D(x, y)
|
||||||
|
|
||||||
|
Use this function for setting the global gravity vector. A sprite canvas layer must be active.
|
||||||
|
|
||||||
|
#ref GetGravity2D
|
||||||
9
doc/files/setspritedensity.txt
Normal file
9
doc/files/setspritedensity.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#title SetSpriteDensity [RCBasic Doc]
|
||||||
|
#header sub SetSpriteDensity( spr_id, density )
|
||||||
|
|
||||||
|
Sets the density of a sprite. Higher density means a heavier sprite.
|
||||||
|
|
||||||
|
Density is used to calculate mass for a sprite.
|
||||||
|
|
||||||
|
#ref GetSpriteDensity
|
||||||
|
|
||||||
6
doc/files/setspritefriction.txt
Normal file
6
doc/files/setspritefriction.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetSpriteFriction [RCBasic Doc]
|
||||||
|
#header sub SetSpriteFriction( spr_id, friction )
|
||||||
|
|
||||||
|
Sets a sprite's friction
|
||||||
|
|
||||||
|
#ref GetSpriteFriction
|
||||||
7
doc/files/setspriterestitution.txt
Normal file
7
doc/files/setspriterestitution.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#title SetSpriteRestitution [RCBasic Doc]
|
||||||
|
#header sub SetSpriteRestitution( spr_id, restitution )
|
||||||
|
|
||||||
|
Sets the restitution coefficient for a sprite
|
||||||
|
|
||||||
|
#ref GetSpriteRestitution
|
||||||
|
|
||||||
6
doc/files/setspriterestitutionthreshold.txt
Normal file
6
doc/files/setspriterestitutionthreshold.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetSpriteRestitutionThreshold [RCBasic Doc]
|
||||||
|
#header sub SetSpriteRestitutionThreshold( spr_id, threshold )
|
||||||
|
|
||||||
|
Sets the restitution threshold for a sprite.
|
||||||
|
|
||||||
|
#ref GetSpriteRestitutionThreshold
|
||||||
6
doc/files/setworld2dautoclearforces.txt
Normal file
6
doc/files/setworld2dautoclearforces.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetWorld2DAutoClearForces [RCBasic Doc]
|
||||||
|
#header sub SetWorld2DAutoClearForces( flag )
|
||||||
|
|
||||||
|
Sets the auto clear forces flag for the active canvas
|
||||||
|
|
||||||
|
#ref GetWorld2DAutoClearForces
|
||||||
6
doc/files/setworld2dpositioniterations.txt
Normal file
6
doc/files/setworld2dpositioniterations.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetWorld2DPositionIterations [RCBasic Doc]
|
||||||
|
#header sub SetWorld2DPositionIterations( p )
|
||||||
|
|
||||||
|
Sets the number of position iterations for the position constraint solver
|
||||||
|
|
||||||
|
#ref GetWorld2DPositionIterations
|
||||||
6
doc/files/setworld2dtimestep.txt
Normal file
6
doc/files/setworld2dtimestep.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetWorld2DTimeStep [RCBasic Doc]
|
||||||
|
#header sub SetWorld2DTimeStep( ts )
|
||||||
|
|
||||||
|
Sets the timestep for the active canvas
|
||||||
|
|
||||||
|
#ref GetWorld2DTimeStep
|
||||||
6
doc/files/setworld2dvelocityiterations.txt
Normal file
6
doc/files/setworld2dvelocityiterations.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#title SetWorld2DVelocityIterations [RCBasic Doc]
|
||||||
|
#header sub SetWorld2DVelocityIterations( v )
|
||||||
|
|
||||||
|
Sets the number of velocity iterations for the velocity constraint solver
|
||||||
|
|
||||||
|
#ref GetWorld2DVelocityIterations
|
||||||
@@ -1 +1 @@
|
|||||||
,n00b,fedora,13.11.2024 20:17,file:///home/n00b/.config/libreoffice/4;
|
,n00b,fedora,15.11.2024 20:29,file:///home/n00b/.config/libreoffice/4;
|
||||||
@@ -520,6 +520,25 @@ rc_setSpriteAwake( SETSPRITEAWAKE_SPR_ID, SETSPRITEAWAKE_FLAG )
|
|||||||
rc_spriteIsAwake( SPRITEISAWAKE_SPR_ID )
|
rc_spriteIsAwake( SPRITEISAWAKE_SPR_ID )
|
||||||
rc_setSpriteFixedRotation( SETSPRITEFIXEDROTATION_SPR_ID, SETSPRITEFIXEDROTATION_FLAG )
|
rc_setSpriteFixedRotation( SETSPRITEFIXEDROTATION_SPR_ID, SETSPRITEFIXEDROTATION_FLAG )
|
||||||
rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID )
|
rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID )
|
||||||
|
rc_setSpriteDensity( SETSPRITEDENSITY_SPR_ID, SETSPRITEDENSITY_DENSITY )
|
||||||
|
rc_getSpriteDensity( GETSPRITEDENSITY_SPR_ID )
|
||||||
|
rc_setSpriteFriction( SETSPRITEFRICTION_SPR_ID, SETSPRITEFRICTION_FRICTION )
|
||||||
|
rc_getSpriteFriction( GETSPRITEFRICTION_SPR_ID )
|
||||||
|
rc_setSpriteRestitution( SETSPRITERESTITUTION_SPR_ID, SETSPRITERESTITUTION_RESTITUTION )
|
||||||
|
rc_getSpriteRestitution( GETSPRITERESTITUTION_SPR_ID )
|
||||||
|
rc_setSpriteRestitutionThreshold( SETSPRITERESTITUTIONTHRESHOLD_SPR_ID, SETSPRITERESTITUTIONTHRESHOLD_THRESHOLD )
|
||||||
|
rc_getSpriteRestitutionThreshold( GETSPRITERESTITUTIONTHRESHOLD_SPR_ID )
|
||||||
|
rc_getSpriteAABB( GETSPRITEAABB_SPR_ID, &GETSPRITEAABB_X1, &GETSPRITEAABB_Y1, &GETSPRITEAABB_X2, &GETSPRITEAABB_Y2 )
|
||||||
|
rc_setGravity2D( SETGRAVITY2D_X, SETGRAVITY2D_Y )
|
||||||
|
rc_getGravity2D( &GETGRAVITY2D_X, &GETGRAVITY2D_Y )
|
||||||
|
rc_setWorld2DTimeStep( SETWORLD2DTIMESTEP_TS )
|
||||||
|
rc_setWorld2DVelocityIterations( SETWORLD2DVELOCITYITERATIONS_V )
|
||||||
|
rc_setWorld2DPositionIterations( SETWORLD2DPOSITIONITERATIONS_P )
|
||||||
|
rc_getWorld2DTimeStep( )
|
||||||
|
rc_getWorld2DVelocityIterations( )
|
||||||
|
rc_getWorld2DPositionIterations( )
|
||||||
|
rc_setWorld2DAutoClearForces( SETWORLD2DAUTOCLEARFORCES_FLAG )
|
||||||
|
rc_getWorld2DAutoClearForces( )
|
||||||
rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT )
|
rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT )
|
||||||
rc_createFrictionJoint( CREATEFRICTIONJOINT_SPRITEA, CREATEFRICTIONJOINT_SPRITEB, CREATEFRICTIONJOINT_X, CREATEFRICTIONJOINT_Y, CREATEFRICTIONJOINT_COLLIDE_CONNECT )
|
rc_createFrictionJoint( CREATEFRICTIONJOINT_SPRITEA, CREATEFRICTIONJOINT_SPRITEB, CREATEFRICTIONJOINT_X, CREATEFRICTIONJOINT_Y, CREATEFRICTIONJOINT_COLLIDE_CONNECT )
|
||||||
rc_createGearJoint( CREATEGEARJOINT_JOINTA, CREATEGEARJOINT_JOINTB, CREATEGEARJOINT_G_RATIO, CREATEGEARJOINT_COLLIDE_CONNECT )
|
rc_createGearJoint( CREATEGEARJOINT_JOINTA, CREATEGEARJOINT_JOINTB, CREATEGEARJOINT_G_RATIO, CREATEGEARJOINT_COLLIDE_CONNECT )
|
||||||
@@ -845,6 +864,8 @@ rc_addSceneSkyDomeEx( ADDSCENESKYDOMEEX_IMG, ADDSCENESKYDOMEEX_HORIRES, ADDSCE
|
|||||||
rc_removeSceneSky( )
|
rc_removeSceneSky( )
|
||||||
rc_setWorld3DMaxSubSteps( SETWORLD3DMAXSUBSTEPS_STEPS )
|
rc_setWorld3DMaxSubSteps( SETWORLD3DMAXSUBSTEPS_STEPS )
|
||||||
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS )
|
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS )
|
||||||
|
rc_getWorld3DMaxSubSteps( )
|
||||||
|
rc_getWorld3DTimeStep( )
|
||||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR )
|
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR )
|
||||||
rc_stopParticleEmitter( STOPPARTICLEEMITTER_ACTOR )
|
rc_stopParticleEmitter( STOPPARTICLEEMITTER_ACTOR )
|
||||||
rc_setParticleDirection( SETPARTICLEDIRECTION_ACTOR, SETPARTICLEDIRECTION_X, SETPARTICLEDIRECTION_Y, SETPARTICLEDIRECTION_Z )
|
rc_setParticleDirection( SETPARTICLEDIRECTION_ACTOR, SETPARTICLEDIRECTION_X, SETPARTICLEDIRECTION_Y, SETPARTICLEDIRECTION_Z )
|
||||||
|
|||||||
@@ -4,3 +4,5 @@ sub AddSceneSkyDomeEx( img, horiRes, vertRes, txPercentage, spherePercentage, ra
|
|||||||
sub RemoveSceneSky( )
|
sub RemoveSceneSky( )
|
||||||
sub SetWorld3DMaxSubSteps( steps )
|
sub SetWorld3DMaxSubSteps( steps )
|
||||||
sub SetWorld3DTimeStep( ts )
|
sub SetWorld3DTimeStep( ts )
|
||||||
|
function GetWorld3DMaxSubSteps()
|
||||||
|
function GetWorld3DTimeStep()
|
||||||
|
|||||||
@@ -30,3 +30,22 @@ sub setSpriteAwake( spr_id, flag)
|
|||||||
function spriteIsAwake( spr_id)
|
function spriteIsAwake( spr_id)
|
||||||
sub setSpriteFixedRotation( spr_id, flag)
|
sub setSpriteFixedRotation( spr_id, flag)
|
||||||
function spriteIsFixedRotation( spr_id)
|
function spriteIsFixedRotation( spr_id)
|
||||||
|
sub SetSpriteDensity( spr_id, density )
|
||||||
|
function GetSpriteDensity( spr_id )
|
||||||
|
sub SetSpriteFriction( spr_id, friction )
|
||||||
|
function GetSpriteFriction( spr_id )
|
||||||
|
sub SetSpriteRestitution( spr_id, restitution )
|
||||||
|
function GetSpriteRestitution( spr_id )
|
||||||
|
sub SetSpriteRestitutionThreshold( spr_id, threshold )
|
||||||
|
function GetSpriteRestitutionThreshold( spr_id )
|
||||||
|
sub GetSpriteAABB( spr_id, ByRef x1, ByRef y1, ByRef x2, ByRef y2 )
|
||||||
|
sub SetGravity2D( x, y )
|
||||||
|
sub GetGravity2D( ByRef x, ByRef y )
|
||||||
|
sub SetWorld2DTimeStep( ts )
|
||||||
|
sub SetWorld2DVelocityIterations( v )
|
||||||
|
sub SetWorld2DPositionIterations( p )
|
||||||
|
function GetWorld2DTimeStep()
|
||||||
|
function GetWorld2DVelocityIterations()
|
||||||
|
function GetWorld2DPositionIterations()
|
||||||
|
sub SetWorld2DAutoClearForces( flag )
|
||||||
|
function GetWorld2DAutoClearForces()
|
||||||
|
|||||||
@@ -912,7 +912,7 @@ int main(int argc, char * argv[])
|
|||||||
{
|
{
|
||||||
string line = "";
|
string line = "";
|
||||||
|
|
||||||
rcbasic_dev("embedded_functions.bas"); rcbasic_output_debug_info(); return 0;
|
//rcbasic_dev("embedded_functions.bas"); rcbasic_output_debug_info(); return 0;
|
||||||
|
|
||||||
string rc_filename = "";// = "tst.bas";
|
string rc_filename = "";// = "tst.bas";
|
||||||
|
|
||||||
|
|||||||
@@ -1516,6 +1516,48 @@ void init_embedded_functions()
|
|||||||
add_embedded_arg("flag", ID_TYPE_NUM);
|
add_embedded_arg("flag", ID_TYPE_NUM);
|
||||||
embed_function("spriteIsFixedRotation", ID_TYPE_FN_NUM);
|
embed_function("spriteIsFixedRotation", ID_TYPE_FN_NUM);
|
||||||
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteDensity", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("density", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteDensity", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteFriction", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("friction", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteFriction", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteRestitution", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("restitution", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteRestitution", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteRestitutionThreshold", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("threshold", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteAABB", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("x1", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y1", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("x2", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y2", ID_TYPE_BYREF_NUM);
|
||||||
|
embed_function("SetGravity2D", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("x", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("y", ID_TYPE_NUM);
|
||||||
|
embed_function("GetGravity2D", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
|
||||||
|
embed_function("SetWorld2DTimeStep", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("ts", ID_TYPE_NUM);
|
||||||
|
embed_function("SetWorld2DVelocityIterations", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("v", ID_TYPE_NUM);
|
||||||
|
embed_function("SetWorld2DPositionIterations", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("p", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld2DTimeStep", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld2DVelocityIterations", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld2DPositionIterations", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("SetWorld2DAutoClearForces", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("flag", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld2DAutoClearForces", ID_TYPE_FN_NUM);
|
||||||
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
|
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
|
||||||
add_embedded_arg("spriteA", ID_TYPE_NUM);
|
add_embedded_arg("spriteA", ID_TYPE_NUM);
|
||||||
add_embedded_arg("spriteB", ID_TYPE_NUM);
|
add_embedded_arg("spriteB", ID_TYPE_NUM);
|
||||||
@@ -2647,6 +2689,8 @@ void init_embedded_functions()
|
|||||||
add_embedded_arg("steps", ID_TYPE_NUM);
|
add_embedded_arg("steps", ID_TYPE_NUM);
|
||||||
embed_function("SetWorld3DTimeStep", ID_TYPE_SUB);
|
embed_function("SetWorld3DTimeStep", ID_TYPE_SUB);
|
||||||
add_embedded_arg("ts", ID_TYPE_NUM);
|
add_embedded_arg("ts", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld3DMaxSubSteps", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld3DTimeStep", ID_TYPE_FN_NUM);
|
||||||
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
||||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||||
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ embedded_functions.bas
|
|||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/tilemaps.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/tilemaps.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/mesh.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/mesh.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor.bas
|
||||||
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor_animation.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor_physics.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor_physics.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/constraint3D.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/constraint3D.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/camera.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/camera.bas
|
||||||
@@ -39,5 +40,4 @@ embedded_functions.bas
|
|||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/lights.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/lights.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/terrain.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/terrain.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/water.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/water.bas
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/actor_animation.bas
|
|
||||||
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/materials.bas
|
/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/materials.bas
|
||||||
|
|||||||
@@ -331,12 +331,10 @@ N main.CanvasClip w 2
|
|||||||
N main.CanvasClip h 3
|
N main.CanvasClip h 3
|
||||||
N main.SetCanvasPhysics2D c_num 0
|
N main.SetCanvasPhysics2D c_num 0
|
||||||
N main.SetCanvasPhysics2D state 1
|
N main.SetCanvasPhysics2D state 1
|
||||||
N main.OpenCanvasSpriteLayer w 0
|
N main.OpenCanvasSpriteLayer viewport_x 0
|
||||||
N main.OpenCanvasSpriteLayer h 1
|
N main.OpenCanvasSpriteLayer viewport_y 1
|
||||||
N main.OpenCanvasSpriteLayer viewport_x 2
|
N main.OpenCanvasSpriteLayer viewport_w 2
|
||||||
N main.OpenCanvasSpriteLayer viewport_y 3
|
N main.OpenCanvasSpriteLayer viewport_h 3
|
||||||
N main.OpenCanvasSpriteLayer viewport_w 4
|
|
||||||
N main.OpenCanvasSpriteLayer viewport_h 5
|
|
||||||
N main.Circle x 0
|
N main.Circle x 0
|
||||||
N main.Circle y 1
|
N main.Circle y 1
|
||||||
N main.Circle radius 2
|
N main.Circle radius 2
|
||||||
@@ -924,6 +922,319 @@ N main.NumSpriteAnimationLoops sprite 0
|
|||||||
N main.SpriteAnimationIsPlaying sprite 0
|
N main.SpriteAnimationIsPlaying sprite 0
|
||||||
N main.DeleteSpriteAnimation sprite 0
|
N main.DeleteSpriteAnimation sprite 0
|
||||||
N main.DeleteSpriteAnimation animation 1
|
N main.DeleteSpriteAnimation animation 1
|
||||||
|
N main.getSpriteCenter spr_id 0
|
||||||
|
BN main.getSpriteCenter x 1
|
||||||
|
BN main.getSpriteCenter y 2
|
||||||
|
N main.setSpriteLinearVelocity spr_id 0
|
||||||
|
N main.setSpriteLinearVelocity x 1
|
||||||
|
N main.setSpriteLinearVelocity y 2
|
||||||
|
N main.getSpriteLinearVelocity spr_id 0
|
||||||
|
BN main.getSpriteLinearVelocity x 1
|
||||||
|
BN main.getSpriteLinearVelocity y 2
|
||||||
|
N main.setSpriteAngularVelocity spr_id 0
|
||||||
|
N main.setSpriteAngularVelocity av 1
|
||||||
|
N main.getSpriteAngularVelocity spr_id 0
|
||||||
|
N main.applySpriteForce spr_id 0
|
||||||
|
N main.applySpriteForce fX 1
|
||||||
|
N main.applySpriteForce fY 2
|
||||||
|
N main.applySpriteForce pX 3
|
||||||
|
N main.applySpriteForce pY 4
|
||||||
|
N main.applySpriteCentralForce spr_id 0
|
||||||
|
N main.applySpriteCentralForce x 1
|
||||||
|
N main.applySpriteCentralForce y 2
|
||||||
|
N main.applySpriteTorque spr_id 0
|
||||||
|
N main.applySpriteTorque torque 1
|
||||||
|
N main.applySpriteLinearImpulse spr_id 0
|
||||||
|
N main.applySpriteLinearImpulse iX 1
|
||||||
|
N main.applySpriteLinearImpulse iY 2
|
||||||
|
N main.applySpriteLinearImpulse pX 3
|
||||||
|
N main.applySpriteLinearImpulse pY 4
|
||||||
|
N main.applySpriteAngularImpulse spr_id 0
|
||||||
|
N main.applySpriteAngularImpulse impulse 1
|
||||||
|
N main.getSpriteMass spr_id 0
|
||||||
|
N main.getSpriteInertia spr_id 0
|
||||||
|
N main.getSpriteWorldPoint spr_id 0
|
||||||
|
N main.getSpriteWorldPoint lX 1
|
||||||
|
N main.getSpriteWorldPoint lY 2
|
||||||
|
BN main.getSpriteWorldPoint x 3
|
||||||
|
BN main.getSpriteWorldPoint y 4
|
||||||
|
N main.getSpriteWorldVector spr_id 0
|
||||||
|
N main.getSpriteWorldVector lX 1
|
||||||
|
N main.getSpriteWorldVector lY 2
|
||||||
|
BN main.getSpriteWorldVector x 3
|
||||||
|
BN main.getSpriteWorldVector y 4
|
||||||
|
N main.getSpriteLocalPoint spr_id 0
|
||||||
|
N main.getSpriteLocalPoint wX 1
|
||||||
|
N main.getSpriteLocalPoint wY 2
|
||||||
|
BN main.getSpriteLocalPoint x 3
|
||||||
|
BN main.getSpriteLocalPoint y 4
|
||||||
|
N main.getSpriteLocalVector spr_id 0
|
||||||
|
N main.getSpriteLocalVector wX 1
|
||||||
|
N main.getSpriteLocalVector wY 2
|
||||||
|
BN main.getSpriteLocalVector x 3
|
||||||
|
BN main.getSpriteLocalVector y 4
|
||||||
|
N main.getSpriteLinearVelocityFromLocalPoint spr_id 0
|
||||||
|
N main.getSpriteLinearVelocityFromLocalPoint pX 1
|
||||||
|
N main.getSpriteLinearVelocityFromLocalPoint pY 2
|
||||||
|
BN main.getSpriteLinearVelocityFromLocalPoint x 3
|
||||||
|
BN main.getSpriteLinearVelocityFromLocalPoint y 4
|
||||||
|
N main.getSpriteLinearVelocityFromWorldPoint spr_id 0
|
||||||
|
N main.getSpriteLinearVelocityFromWorldPoint wX 1
|
||||||
|
N main.getSpriteLinearVelocityFromWorldPoint wY 2
|
||||||
|
BN main.getSpriteLinearVelocityFromWorldPoint x 3
|
||||||
|
BN main.getSpriteLinearVelocityFromWorldPoint y 4
|
||||||
|
N main.getSpriteLinearDamping spr_id 0
|
||||||
|
N main.setSpriteLinearDamping spr_id 0
|
||||||
|
N main.setSpriteLinearDamping linearDamping 1
|
||||||
|
N main.getSpriteAngularDamping spr_id 0
|
||||||
|
N main.setSpriteAngularDamping spr_id 0
|
||||||
|
N main.setSpriteAngularDamping angularDamping 1
|
||||||
|
N main.getSpriteGravityScale spr_id 0
|
||||||
|
N main.setSpriteGravityScale spr_id 0
|
||||||
|
N main.setSpriteGravityScale g_scale 1
|
||||||
|
N main.setSpriteBullet spr_id 0
|
||||||
|
N main.setSpriteBullet flag 1
|
||||||
|
N main.spriteIsBullet spr_id 0
|
||||||
|
N main.setSpriteSleepAllowed spr_id 0
|
||||||
|
N main.setSpriteSleepAllowed flag 1
|
||||||
|
N main.spriteSleepAllowed spr_id 0
|
||||||
|
N main.setSpriteAwake spr_id 0
|
||||||
|
N main.setSpriteAwake flag 1
|
||||||
|
N main.spriteIsAwake spr_id 0
|
||||||
|
N main.setSpriteFixedRotation spr_id 0
|
||||||
|
N main.setSpriteFixedRotation flag 1
|
||||||
|
N main.spriteIsFixedRotation spr_id 0
|
||||||
|
N main.SetSpriteDensity spr_id 0
|
||||||
|
N main.SetSpriteDensity density 1
|
||||||
|
N main.GetSpriteDensity spr_id 0
|
||||||
|
N main.SetSpriteFriction spr_id 0
|
||||||
|
N main.SetSpriteFriction friction 1
|
||||||
|
N main.GetSpriteFriction spr_id 0
|
||||||
|
N main.SetSpriteRestitution spr_id 0
|
||||||
|
N main.SetSpriteRestitution restitution 1
|
||||||
|
N main.GetSpriteRestitution spr_id 0
|
||||||
|
N main.SetSpriteRestitutionThreshold spr_id 0
|
||||||
|
N main.SetSpriteRestitutionThreshold threshold 1
|
||||||
|
N main.GetSpriteAABB spr_id 0
|
||||||
|
BN main.GetSpriteAABB x1 1
|
||||||
|
BN main.GetSpriteAABB y1 2
|
||||||
|
BN main.GetSpriteAABB x2 3
|
||||||
|
BN main.GetSpriteAABB y2 4
|
||||||
|
N main.SetGravity2D x 0
|
||||||
|
N main.SetGravity2D y 1
|
||||||
|
BN main.GetGravity2D x 0
|
||||||
|
BN main.GetGravity2D y 1
|
||||||
|
N main.SetWorld2DTimeStep ts 0
|
||||||
|
N main.SetWorld2DVelocityIterations v 0
|
||||||
|
N main.SetWorld2DPositionIterations p 0
|
||||||
|
N main.SetWorld2DAutoClearForces flag 0
|
||||||
|
N main.createDistanceJoint spriteA 0
|
||||||
|
N main.createDistanceJoint spriteB 1
|
||||||
|
N main.createDistanceJoint aX 2
|
||||||
|
N main.createDistanceJoint aY 3
|
||||||
|
N main.createDistanceJoint bX 4
|
||||||
|
N main.createDistanceJoint bY 5
|
||||||
|
N main.createDistanceJoint collide_connect 6
|
||||||
|
N main.createFrictionJoint spriteA 0
|
||||||
|
N main.createFrictionJoint spriteB 1
|
||||||
|
N main.createFrictionJoint x 2
|
||||||
|
N main.createFrictionJoint y 3
|
||||||
|
N main.createFrictionJoint collide_connect 4
|
||||||
|
N main.createGearJoint jointA 0
|
||||||
|
N main.createGearJoint jointB 1
|
||||||
|
N main.createGearJoint g_ratio 2
|
||||||
|
N main.createGearJoint collide_connect 3
|
||||||
|
N main.createMotorJoint spriteA 0
|
||||||
|
N main.createMotorJoint spriteB 1
|
||||||
|
N main.createMotorJoint collide_connect 2
|
||||||
|
N main.createPrismaticJoint spriteA 0
|
||||||
|
N main.createPrismaticJoint spriteB 1
|
||||||
|
N main.createPrismaticJoint aX 2
|
||||||
|
N main.createPrismaticJoint aY 3
|
||||||
|
N main.createPrismaticJoint axisX 4
|
||||||
|
N main.createPrismaticJoint axisY 5
|
||||||
|
N main.createPrismaticJoint collide_connect 6
|
||||||
|
N main.createPulleyJoint spriteA 0
|
||||||
|
N main.createPulleyJoint spriteB 1
|
||||||
|
N main.createPulleyJoint gaX 2
|
||||||
|
N main.createPulleyJoint gaY 3
|
||||||
|
N main.createPulleyJoint gbX 4
|
||||||
|
N main.createPulleyJoint gbY 5
|
||||||
|
N main.createPulleyJoint aX 6
|
||||||
|
N main.createPulleyJoint aY 7
|
||||||
|
N main.createPulleyJoint bX 8
|
||||||
|
N main.createPulleyJoint bY 9
|
||||||
|
N main.createPulleyJoint j_ratio 10
|
||||||
|
N main #fn11 11
|
||||||
|
N main.createPulleyJoint collide_connect 11
|
||||||
|
N main.createRevoluteJoint spriteA 0
|
||||||
|
N main.createRevoluteJoint spriteB 1
|
||||||
|
N main.createRevoluteJoint x 2
|
||||||
|
N main.createRevoluteJoint y 3
|
||||||
|
N main.createRevoluteJoint collide_connect 4
|
||||||
|
N main.createWeldJoint spriteA 0
|
||||||
|
N main.createWeldJoint spriteB 1
|
||||||
|
N main.createWeldJoint x 2
|
||||||
|
N main.createWeldJoint y 3
|
||||||
|
N main.createWeldJoint collide_connect 4
|
||||||
|
N main.createWheelJoint spriteA 0
|
||||||
|
N main.createWheelJoint spriteB 1
|
||||||
|
N main.createWheelJoint aX 2
|
||||||
|
N main.createWheelJoint aY 3
|
||||||
|
N main.createWheelJoint axisX 4
|
||||||
|
N main.createWheelJoint axisY 5
|
||||||
|
N main.createWheelJoint collide_connect 6
|
||||||
|
N main.getJointWorldAnchorA joint_id 0
|
||||||
|
BN main.getJointWorldAnchorA x 1
|
||||||
|
BN main.getJointWorldAnchorA y 2
|
||||||
|
N main.getJointWorldAnchorB joint_id 0
|
||||||
|
BN main.getJointWorldAnchorB x 1
|
||||||
|
BN main.getJointWorldAnchorB y 2
|
||||||
|
N main.getJointReactionForce joint_id 0
|
||||||
|
N main.getJointReactionForce inv_dt 1
|
||||||
|
BN main.getJointReactionForce x 2
|
||||||
|
BN main.getJointReactionForce y 3
|
||||||
|
N main.getJointReactionTorque joint_id 0
|
||||||
|
N main.getJointReactionTorque inv_dt 1
|
||||||
|
N main.getJointLocalAnchorA joint_id 0
|
||||||
|
BN main.getJointLocalAnchorA x 1
|
||||||
|
BN main.getJointLocalAnchorA y 2
|
||||||
|
N main.getJointLocalAnchorB joint_id 0
|
||||||
|
BN main.getJointLocalAnchorB x 1
|
||||||
|
BN main.getJointLocalAnchorB y 2
|
||||||
|
N main.setJointLength joint_id 0
|
||||||
|
N main.setJointLength jlen 1
|
||||||
|
N main.getJointLength joint_id 0
|
||||||
|
N main.setJointMinLength joint_id 0
|
||||||
|
N main.setJointMinLength jlen 1
|
||||||
|
N main.getJointMinLength joint_id 0
|
||||||
|
N main.setJointMaxLength joint_id 0
|
||||||
|
N main.setJointMaxLength jlen 1
|
||||||
|
N main.getJointMaxLength joint_id 0
|
||||||
|
N main.getJointCurrentLength joint_id 0
|
||||||
|
N main.setJointStiffness joint_id 0
|
||||||
|
N main.setJointStiffness stiffness 1
|
||||||
|
N main.getJointStiffness joint_id 0
|
||||||
|
N main.setJointDamping joint_id 0
|
||||||
|
N main.setJointDamping damping 1
|
||||||
|
N main.getJointDamping joint_id 0
|
||||||
|
N main.setJointMaxForce joint_id 0
|
||||||
|
N main.setJointMaxForce force 1
|
||||||
|
N main.getJointMaxForce joint_id 0
|
||||||
|
N main.setJointMaxTorque joint_id 0
|
||||||
|
N main.setJointMaxTorque torque 1
|
||||||
|
N main.getJointMaxTorque joint_id 0
|
||||||
|
N main.setJointCorrectionFactor joint_id 0
|
||||||
|
N main.setJointCorrectionFactor factor 1
|
||||||
|
N main.getJointCorrectionFactor joint_id 0
|
||||||
|
N main.setJointRatio joint_id 0
|
||||||
|
N main.setJointRatio j_ratio 1
|
||||||
|
N main.getJointRatio joint_id 0
|
||||||
|
N main.setJointLinearOffset joint_id 0
|
||||||
|
N main.setJointLinearOffset x 1
|
||||||
|
N main.setJointLinearOffset y 2
|
||||||
|
N main.getJointLinearOffset joint_id 0
|
||||||
|
BN main.getJointLinearOffset x 1
|
||||||
|
BN main.getJointLinearOffset y 2
|
||||||
|
N main.setJointAngularOffset joint_id 0
|
||||||
|
N main.setJointAngularOffset angleOffset 1
|
||||||
|
N main.getJointAngularOffset joint_id 0
|
||||||
|
N main.getJointLocalAxisA joint_id 0
|
||||||
|
BN main.getJointLocalAxisA x 1
|
||||||
|
BN main.getJointLocalAxisA y 2
|
||||||
|
N main.getJointReferenceAngle joint_id 0
|
||||||
|
N main.getJointTranslation joint_id 0
|
||||||
|
N main.getJointSpeed joint_id 0
|
||||||
|
N main.jointIsLimitEnabled joint_id 0
|
||||||
|
N main.enableJointLimit joint_id 0
|
||||||
|
N main.enableJointLimit flag 1
|
||||||
|
N main.getJointLowerLimit joint_id 0
|
||||||
|
N main.getJointUpperLimit joint_id 0
|
||||||
|
N main.setJointLimits joint_id 0
|
||||||
|
N main.setJointLimits lower_limit 1
|
||||||
|
N main.setJointLimits upper_limit 2
|
||||||
|
N main.jointMotorIsEnabled joint_id 0
|
||||||
|
N main.enableJointMotor joint_id 0
|
||||||
|
N main.enableJointMotor flag 1
|
||||||
|
N main.setJointMotorSpeed joint_id 0
|
||||||
|
N main.setJointMotorSpeed speed 1
|
||||||
|
N main.getJointMotorSpeed joint_id 0
|
||||||
|
N main.setJointMaxMotorForce joint_id 0
|
||||||
|
N main.setJointMaxMotorForce force 1
|
||||||
|
N main.getJointMaxMotorForce joint_id 0
|
||||||
|
N main.getJointMotorForce joint_id 0
|
||||||
|
N main.getJointMotorForce inv_dt 1
|
||||||
|
N main.setJointMaxMotorTorque joint_id 0
|
||||||
|
N main.setJointMaxMotorTorque torque 1
|
||||||
|
N main.getJointMaxMotorTorque joint_id 0
|
||||||
|
N main.getJointMotorTorque joint_id 0
|
||||||
|
N main.getJointMotorTorque inv_dt 1
|
||||||
|
N main.getJointGroundAnchorA joint_id 0
|
||||||
|
BN main.getJointGroundAnchorA x 1
|
||||||
|
BN main.getJointGroundAnchorA y 2
|
||||||
|
N main.getJointGroundAnchorB joint_id 0
|
||||||
|
BN main.getJointGroundAnchorB x 1
|
||||||
|
BN main.getJointGroundAnchorB y 2
|
||||||
|
N main.getJointLengthA joint_id 0
|
||||||
|
N main.getJointLengthB joint_id 0
|
||||||
|
N main.getJointCurrentLengthA joint_id 0
|
||||||
|
N main.getJointCurrentLengthB joint_id 0
|
||||||
|
N main.setJointOrigin joint_id 0
|
||||||
|
N main.setJointOrigin x 1
|
||||||
|
N main.setJointOrigin y 2
|
||||||
|
N main.getJointAngle joint_id 0
|
||||||
|
N main.getJointLinearSpeed joint_id 0
|
||||||
|
N main.getJointAngularSpeed joint_id 0
|
||||||
|
N main.DeleteJoint joint_id 0
|
||||||
|
N main.CreateTileSet img_id 0
|
||||||
|
N main.CreateTileSet tile_w 1
|
||||||
|
N main.CreateTileSet tile_h 2
|
||||||
|
N main.SetTileAnimationLength tileset 0
|
||||||
|
N main.SetTileAnimationLength base_tile 1
|
||||||
|
N main.SetTileAnimationLength num_frames 2
|
||||||
|
N main.GetTileAnimationLength tileset 0
|
||||||
|
N main.GetTileAnimationLength base_tile 1
|
||||||
|
N main.SetTileAnimationFrame tileset 0
|
||||||
|
N main.SetTileAnimationFrame base_tile 1
|
||||||
|
N main.SetTileAnimationFrame anim_frame 2
|
||||||
|
N main.SetTileAnimationFrame tile_frame 3
|
||||||
|
N main.GetTileAnimationFrame tileset 0
|
||||||
|
N main.GetTileAnimationFrame base_tile 1
|
||||||
|
N main.GetTileAnimationFrame anim_frame 2
|
||||||
|
N main.SetTileAnimationSpeed tileset 0
|
||||||
|
N main.SetTileAnimationSpeed base_tile 1
|
||||||
|
N main.SetTileAnimationSpeed speed 2
|
||||||
|
N main.GetTileAnimationSpeed tileset 0
|
||||||
|
N main.GetTileAnimationSpeed base_tile 1
|
||||||
|
N main.CreateTileMap tileset 0
|
||||||
|
N main.CreateTileMap widthInTiles 1
|
||||||
|
N main.CreateTileMap heightInTiles 2
|
||||||
|
N main.SetTileMapSize tilemap 0
|
||||||
|
N main.SetTileMapSize widthInTiles 1
|
||||||
|
N main.SetTileMapSize heightInTiles 2
|
||||||
|
N main.GetTileMapSize tilemap 0
|
||||||
|
BN main.GetTileMapSize widthInTiles 1
|
||||||
|
BN main.GetTileMapSize heightInTiles 2
|
||||||
|
N main.SetTile tilemap 0
|
||||||
|
N main.SetTile tile 1
|
||||||
|
N main.SetTile x 2
|
||||||
|
N main.SetTile y 3
|
||||||
|
N main.GetTile tilemap 0
|
||||||
|
N main.GetTile x 1
|
||||||
|
N main.GetTile y 2
|
||||||
|
N main.FillTile tilemap 0
|
||||||
|
N main.FillTile tile 1
|
||||||
|
N main.FillTile x 2
|
||||||
|
N main.FillTile y 3
|
||||||
|
N main.FillTile widthInTiles 4
|
||||||
|
N main.FillTile heightInTiles 5
|
||||||
|
N main.DrawTileMap tilemap 0
|
||||||
|
N main.DrawTileMap x 1
|
||||||
|
N main.DrawTileMap y 2
|
||||||
|
N main.DrawTileMap w 3
|
||||||
|
N main.DrawTileMap h 4
|
||||||
|
N main.DrawTileMap offset_x 5
|
||||||
|
N main.DrawTileMap offset_y 6
|
||||||
S main.LoadMesh mesh_file$ 0
|
S main.LoadMesh mesh_file$ 0
|
||||||
N main.DeleteMesh mesh 0
|
N main.DeleteMesh mesh 0
|
||||||
N main.AddMeshBuffer mesh 0
|
N main.AddMeshBuffer mesh 0
|
||||||
@@ -1007,6 +1318,40 @@ N main.GetActorAutoCulling actor 0
|
|||||||
N main.AddActorShadow actor 0
|
N main.AddActorShadow actor 0
|
||||||
N main.RemoveActorShadow actor 0
|
N main.RemoveActorShadow actor 0
|
||||||
N main.ActorExists actor 0
|
N main.ActorExists actor 0
|
||||||
|
N main.CreateActorAnimation actor 0
|
||||||
|
N main.CreateActorAnimation start_frame 1
|
||||||
|
N main.CreateActorAnimation end_frame 2
|
||||||
|
N main.CreateActorAnimation speed 3
|
||||||
|
N main.SetActorAnimation actor 0
|
||||||
|
N main.SetActorAnimation animation 1
|
||||||
|
N main.SetActorAnimation num_loops 2
|
||||||
|
N main.SetActorAnimationSpeed actor 0
|
||||||
|
N main.SetActorAnimationSpeed animation 1
|
||||||
|
N main.SetActorAnimationSpeed speed 2
|
||||||
|
N main.SetActorAnimationFrames actor 0
|
||||||
|
N main.SetActorAnimationFrames animation 1
|
||||||
|
N main.SetActorAnimationFrames start_frame 2
|
||||||
|
N main.SetActorAnimationFrames end_frame 3
|
||||||
|
N main.GetActorCurrentAnimation actor 0
|
||||||
|
N main.GetActorAnimationSpeed actor 0
|
||||||
|
N main.GetActorAnimationSpeed animation 1
|
||||||
|
N main.GetActorAnimationStartFrame actor 0
|
||||||
|
N main.GetActorAnimationStartFrame animation 1
|
||||||
|
N main.GetActorAnimationEndFrame actor 0
|
||||||
|
N main.GetActorAnimationEndFrame animation 1
|
||||||
|
N main.SetActorFrame actor 0
|
||||||
|
N main.SetActorFrame frame 1
|
||||||
|
N main.GetActorFrame actor 0
|
||||||
|
N main.ActorAnimationIsPlaying actor 0
|
||||||
|
N main.NumActorAnimationLoops actor 0
|
||||||
|
N main.SetActorMD2Animation actor 0
|
||||||
|
N main.SetActorMD2Animation anim 1
|
||||||
|
N main.SetActorMD2Animation num_loops 2
|
||||||
|
N main.SetActorMD2AnimationByName actor 0
|
||||||
|
S main.SetActorMD2AnimationByName anim_name$ 0
|
||||||
|
N main.SetActorMD2AnimationByName num_loops 1
|
||||||
|
N main.DeleteActorAnimation actor 0
|
||||||
|
N main.DeleteActorAnimation animation 1
|
||||||
N main.SetGravity3D x 0
|
N main.SetGravity3D x 0
|
||||||
N main.SetGravity3D y 1
|
N main.SetGravity3D y 1
|
||||||
N main.SetGravity3D z 2
|
N main.SetGravity3D z 2
|
||||||
@@ -1136,10 +1481,10 @@ N main.applyActorImpulseWorld rel_y 5
|
|||||||
N main.applyActorImpulseWorld rel_z 6
|
N main.applyActorImpulseWorld rel_z 6
|
||||||
N main.clearActorForces actor 0
|
N main.clearActorForces actor 0
|
||||||
N main.updateActorInertiaTensor actor 0
|
N main.updateActorInertiaTensor actor 0
|
||||||
N main.getActorCOMPosition actor 0
|
N main.getActorCenter actor 0
|
||||||
BN main.getActorCOMPosition x 1
|
BN main.getActorCenter x 1
|
||||||
BN main.getActorCOMPosition y 2
|
BN main.getActorCenter y 2
|
||||||
BN main.getActorCOMPosition z 3
|
BN main.getActorCenter z 3
|
||||||
N main.getActorRotationQ actor 0
|
N main.getActorRotationQ actor 0
|
||||||
BN main.getActorRotationQ x 1
|
BN main.getActorRotationQ x 1
|
||||||
BN main.getActorRotationQ y 2
|
BN main.getActorRotationQ y 2
|
||||||
@@ -1169,13 +1514,13 @@ N main.setActorAngularVelocityWorld actor 0
|
|||||||
N main.setActorAngularVelocityWorld x 1
|
N main.setActorAngularVelocityWorld x 1
|
||||||
N main.setActorAngularVelocityWorld y 2
|
N main.setActorAngularVelocityWorld y 2
|
||||||
N main.setActorAngularVelocityWorld z 3
|
N main.setActorAngularVelocityWorld z 3
|
||||||
N main.getActorLocalPointVelocity actor 0
|
N main.getActorVelocityInLocalPoint actor 0
|
||||||
N main.getActorLocalPointVelocity rel_x 1
|
N main.getActorVelocityInLocalPoint rel_x 1
|
||||||
N main.getActorLocalPointVelocity rel_y 2
|
N main.getActorVelocityInLocalPoint rel_y 2
|
||||||
N main.getActorLocalPointVelocity rel_z 3
|
N main.getActorVelocityInLocalPoint rel_z 3
|
||||||
BN main.getActorLocalPointVelocity x 4
|
BN main.getActorVelocityInLocalPoint x 4
|
||||||
BN main.getActorLocalPointVelocity y 5
|
BN main.getActorVelocityInLocalPoint y 5
|
||||||
BN main.getActorLocalPointVelocity z 6
|
BN main.getActorVelocityInLocalPoint z 6
|
||||||
N main.getActorLinearVelocityLocal actor 0
|
N main.getActorLinearVelocityLocal actor 0
|
||||||
BN main.getActorLinearVelocityLocal x 1
|
BN main.getActorLinearVelocityLocal x 1
|
||||||
BN main.getActorLinearVelocityLocal y 2
|
BN main.getActorLinearVelocityLocal y 2
|
||||||
@@ -1655,40 +2000,6 @@ N main.SetTerrainPatchLOD actor 0
|
|||||||
N main.SetTerrainPatchLOD patchX 1
|
N main.SetTerrainPatchLOD patchX 1
|
||||||
N main.SetTerrainPatchLOD patchZ 2
|
N main.SetTerrainPatchLOD patchZ 2
|
||||||
N main.SetTerrainPatchLOD LOD 3
|
N main.SetTerrainPatchLOD LOD 3
|
||||||
N main.CreateActorAnimation actor 0
|
|
||||||
N main.CreateActorAnimation start_frame 1
|
|
||||||
N main.CreateActorAnimation end_frame 2
|
|
||||||
N main.CreateActorAnimation speed 3
|
|
||||||
N main.SetActorAnimation actor 0
|
|
||||||
N main.SetActorAnimation animation 1
|
|
||||||
N main.SetActorAnimation num_loops 2
|
|
||||||
N main.SetActorAnimationSpeed actor 0
|
|
||||||
N main.SetActorAnimationSpeed animation 1
|
|
||||||
N main.SetActorAnimationSpeed speed 2
|
|
||||||
N main.SetActorAnimationFrames actor 0
|
|
||||||
N main.SetActorAnimationFrames animation 1
|
|
||||||
N main.SetActorAnimationFrames start_frame 2
|
|
||||||
N main.SetActorAnimationFrames end_frame 3
|
|
||||||
N main.GetActorCurrentAnimation actor 0
|
|
||||||
N main.GetActorAnimationSpeed actor 0
|
|
||||||
N main.GetActorAnimationSpeed animation 1
|
|
||||||
N main.GetActorAnimationStartFrame actor 0
|
|
||||||
N main.GetActorAnimationStartFrame animation 1
|
|
||||||
N main.GetActorAnimationEndFrame actor 0
|
|
||||||
N main.GetActorAnimationEndFrame animation 1
|
|
||||||
N main.SetActorFrame actor 0
|
|
||||||
N main.SetActorFrame frame 1
|
|
||||||
N main.GetActorFrame actor 0
|
|
||||||
N main.ActorAnimationIsPlaying actor 0
|
|
||||||
N main.NumActorAnimationLoops actor 0
|
|
||||||
N main.SetActorMD2Animation actor 0
|
|
||||||
N main.SetActorMD2Animation anim 1
|
|
||||||
N main.SetActorMD2Animation num_loops 2
|
|
||||||
N main.SetActorMD2AnimationByName actor 0
|
|
||||||
S main.SetActorMD2AnimationByName anim_name$ 0
|
|
||||||
N main.SetActorMD2AnimationByName num_loops 1
|
|
||||||
N main.DeleteActorAnimation actor 0
|
|
||||||
N main.DeleteActorAnimation animation 1
|
|
||||||
N main.deleteMaterial material_id 0
|
N main.deleteMaterial material_id 0
|
||||||
N main.setActorMaterial actor 0
|
N main.setActorMaterial actor 0
|
||||||
N main.setActorMaterial material_num 1
|
N main.setActorMaterial material_num 1
|
||||||
|
|||||||
Binary file not shown.
@@ -1510,6 +1510,48 @@ add_embedded_arg("spr_id", ID_TYPE_NUM);
|
|||||||
add_embedded_arg("flag", ID_TYPE_NUM);
|
add_embedded_arg("flag", ID_TYPE_NUM);
|
||||||
embed_function("spriteIsFixedRotation", ID_TYPE_FN_NUM);
|
embed_function("spriteIsFixedRotation", ID_TYPE_FN_NUM);
|
||||||
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteDensity", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("density", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteDensity", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteFriction", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("friction", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteFriction", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteRestitution", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("restitution", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteRestitution", ID_TYPE_FN_NUM);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
embed_function("SetSpriteRestitutionThreshold", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("threshold", ID_TYPE_NUM);
|
||||||
|
embed_function("GetSpriteAABB", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("spr_id", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("x1", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y1", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("x2", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y2", ID_TYPE_BYREF_NUM);
|
||||||
|
embed_function("SetGravity2D", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("x", ID_TYPE_NUM);
|
||||||
|
add_embedded_arg("y", ID_TYPE_NUM);
|
||||||
|
embed_function("GetGravity2D", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
|
||||||
|
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
|
||||||
|
embed_function("SetWorld2DTimeStep", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("ts", ID_TYPE_NUM);
|
||||||
|
embed_function("SetWorld2DVelocityIterations", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("v", ID_TYPE_NUM);
|
||||||
|
embed_function("SetWorld2DPositionIterations", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("p", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld2DTimeStep", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld2DVelocityIterations", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld2DPositionIterations", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("SetWorld2DAutoClearForces", ID_TYPE_SUB);
|
||||||
|
add_embedded_arg("flag", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld2DAutoClearForces", ID_TYPE_FN_NUM);
|
||||||
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
|
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
|
||||||
add_embedded_arg("spriteA", ID_TYPE_NUM);
|
add_embedded_arg("spriteA", ID_TYPE_NUM);
|
||||||
add_embedded_arg("spriteB", ID_TYPE_NUM);
|
add_embedded_arg("spriteB", ID_TYPE_NUM);
|
||||||
@@ -2641,6 +2683,8 @@ embed_function("SetWorld3DMaxSubSteps", ID_TYPE_SUB);
|
|||||||
add_embedded_arg("steps", ID_TYPE_NUM);
|
add_embedded_arg("steps", ID_TYPE_NUM);
|
||||||
embed_function("SetWorld3DTimeStep", ID_TYPE_SUB);
|
embed_function("SetWorld3DTimeStep", ID_TYPE_SUB);
|
||||||
add_embedded_arg("ts", ID_TYPE_NUM);
|
add_embedded_arg("ts", ID_TYPE_NUM);
|
||||||
|
embed_function("GetWorld3DMaxSubSteps", ID_TYPE_FN_NUM);
|
||||||
|
embed_function("GetWorld3DTimeStep", ID_TYPE_FN_NUM);
|
||||||
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
||||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||||
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1592,6 +1592,60 @@ case FN_setSpriteFixedRotation: //Sub Procedure
|
|||||||
case FN_spriteIsFixedRotation: //Number Function
|
case FN_spriteIsFixedRotation: //Number Function
|
||||||
rc_push_num(rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID ));
|
rc_push_num(rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID ));
|
||||||
break;
|
break;
|
||||||
|
case FN_SetSpriteDensity: //Sub Procedure
|
||||||
|
rc_setSpriteDensity( SETSPRITEDENSITY_SPR_ID, SETSPRITEDENSITY_DENSITY );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteDensity: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteDensity( GETSPRITEDENSITY_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteFriction: //Sub Procedure
|
||||||
|
rc_setSpriteFriction( SETSPRITEFRICTION_SPR_ID, SETSPRITEFRICTION_FRICTION );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteFriction: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteFriction( GETSPRITEFRICTION_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteRestitution: //Sub Procedure
|
||||||
|
rc_setSpriteRestitution( SETSPRITERESTITUTION_SPR_ID, SETSPRITERESTITUTION_RESTITUTION );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteRestitution: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteRestitution( GETSPRITERESTITUTION_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteRestitutionThreshold: //Sub Procedure
|
||||||
|
rc_setSpriteRestitutionThreshold( SETSPRITERESTITUTIONTHRESHOLD_SPR_ID, SETSPRITERESTITUTIONTHRESHOLD_THRESHOLD );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteAABB: //Sub Procedure
|
||||||
|
rc_getSpriteAABB( GETSPRITEAABB_SPR_ID, &GETSPRITEAABB_X1, &GETSPRITEAABB_Y1, &GETSPRITEAABB_X2, &GETSPRITEAABB_Y2 );
|
||||||
|
break;
|
||||||
|
case FN_SetGravity2D: //Sub Procedure
|
||||||
|
rc_setGravity2D( SETGRAVITY2D_X, SETGRAVITY2D_Y );
|
||||||
|
break;
|
||||||
|
case FN_GetGravity2D: //Sub Procedure
|
||||||
|
rc_getGravity2D( &GETGRAVITY2D_X, &GETGRAVITY2D_Y );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DTimeStep: //Sub Procedure
|
||||||
|
rc_setWorld2DTimeStep( SETWORLD2DTIMESTEP_TS );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DVelocityIterations: //Sub Procedure
|
||||||
|
rc_setWorld2DVelocityIterations( SETWORLD2DVELOCITYITERATIONS_V );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DPositionIterations: //Sub Procedure
|
||||||
|
rc_setWorld2DPositionIterations( SETWORLD2DPOSITIONITERATIONS_P );
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DTimeStep: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DTimeStep( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DVelocityIterations: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DVelocityIterations( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DPositionIterations: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DPositionIterations( ));
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DAutoClearForces: //Sub Procedure
|
||||||
|
rc_setWorld2DAutoClearForces( SETWORLD2DAUTOCLEARFORCES_FLAG );
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DAutoClearForces: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DAutoClearForces( ));
|
||||||
|
break;
|
||||||
case FN_createDistanceJoint: //Number Function
|
case FN_createDistanceJoint: //Number Function
|
||||||
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
|
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
|
||||||
break;
|
break;
|
||||||
@@ -2567,6 +2621,12 @@ case FN_SetWorld3DMaxSubSteps: //Sub Procedure
|
|||||||
case FN_SetWorld3DTimeStep: //Sub Procedure
|
case FN_SetWorld3DTimeStep: //Sub Procedure
|
||||||
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS );
|
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS );
|
||||||
break;
|
break;
|
||||||
|
case FN_GetWorld3DMaxSubSteps: //Number Function
|
||||||
|
rc_push_num(rc_getWorld3DMaxSubSteps( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld3DTimeStep: //Number Function
|
||||||
|
rc_push_num(rc_getWorld3DTimeStep( ));
|
||||||
|
break;
|
||||||
case FN_startParticleEmitter: //Sub Procedure
|
case FN_startParticleEmitter: //Sub Procedure
|
||||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -661,23 +661,17 @@ bool rcbasic_load(std::string filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t readInt()
|
uint64_t readInt()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < sizeof(uint64_t); i++)
|
readint_val.i = ((uint64_t*)&segment[current_segment][current_address] )[0];
|
||||||
{
|
current_address += sizeof(uint64_t);
|
||||||
readint_val.data[i] = segment[current_segment][current_address];
|
return readint_val.i;
|
||||||
current_address++;
|
|
||||||
}
|
|
||||||
return readint_val.i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double readDouble()
|
double readDouble()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < sizeof(double); i++)
|
readdouble_val.f = ((double*)&segment[current_segment][current_address] )[0];
|
||||||
{
|
current_address += sizeof(double);
|
||||||
readdouble_val.data[i] = segment[current_segment][current_address];
|
return readdouble_val.f;
|
||||||
current_address++;
|
|
||||||
}
|
|
||||||
return readdouble_val.f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dbg_1(uint32_t dbg_fn, uint64_t arg1, uint64_t arg2)
|
void dbg_1(uint32_t dbg_fn, uint64_t arg1, uint64_t arg2)
|
||||||
@@ -4447,7 +4441,9 @@ int main(int argc, char * argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//ogles2 test
|
//ogles2 test
|
||||||
|
#ifdef RC_TESTING
|
||||||
rc_intern_dirChange("/home/n00b/projects/rcbasic_alpha3/test_project");
|
rc_intern_dirChange("/home/n00b/projects/rcbasic_alpha3/test_project");
|
||||||
|
#endif
|
||||||
rc_filename = "main.cbc";
|
rc_filename = "main.cbc";
|
||||||
//---------------
|
//---------------
|
||||||
|
|
||||||
|
|||||||
@@ -307,6 +307,9 @@ int rc_createAnimatedActor(int mesh_id)
|
|||||||
animation.frame_start_time = SDL_GetTicks();
|
animation.frame_start_time = SDL_GetTicks();
|
||||||
animation.frame_swap_time = 1000/60;
|
animation.frame_swap_time = 1000/60;
|
||||||
rc_actor[actor_id].animation.push_back(animation);
|
rc_actor[actor_id].animation.push_back(animation);
|
||||||
|
rc_actor[actor_id].current_animation = 0;
|
||||||
|
rc_actor[actor_id].current_animation_loop = 0;
|
||||||
|
rc_actor[actor_id].num_animation_loops = 0;
|
||||||
rc_animEndCallBack* anim_callback = new rc_animEndCallBack();
|
rc_animEndCallBack* anim_callback = new rc_animEndCallBack();
|
||||||
anim_callback->ref_actor = &rc_actor[actor_id];
|
anim_callback->ref_actor = &rc_actor[actor_id];
|
||||||
anim_callback->OnAnimationEnd(node);
|
anim_callback->OnAnimationEnd(node);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1592,6 +1592,60 @@ case FN_setSpriteFixedRotation: //Sub Procedure
|
|||||||
case FN_spriteIsFixedRotation: //Number Function
|
case FN_spriteIsFixedRotation: //Number Function
|
||||||
rc_push_num(rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID ));
|
rc_push_num(rc_spriteIsFixedRotation( SPRITEISFIXEDROTATION_SPR_ID ));
|
||||||
break;
|
break;
|
||||||
|
case FN_SetSpriteDensity: //Sub Procedure
|
||||||
|
rc_setSpriteDensity( SETSPRITEDENSITY_SPR_ID, SETSPRITEDENSITY_DENSITY );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteDensity: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteDensity( GETSPRITEDENSITY_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteFriction: //Sub Procedure
|
||||||
|
rc_setSpriteFriction( SETSPRITEFRICTION_SPR_ID, SETSPRITEFRICTION_FRICTION );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteFriction: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteFriction( GETSPRITEFRICTION_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteRestitution: //Sub Procedure
|
||||||
|
rc_setSpriteRestitution( SETSPRITERESTITUTION_SPR_ID, SETSPRITERESTITUTION_RESTITUTION );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteRestitution: //Number Function
|
||||||
|
rc_push_num(rc_getSpriteRestitution( GETSPRITERESTITUTION_SPR_ID ));
|
||||||
|
break;
|
||||||
|
case FN_SetSpriteRestitutionThreshold: //Sub Procedure
|
||||||
|
rc_setSpriteRestitutionThreshold( SETSPRITERESTITUTIONTHRESHOLD_SPR_ID, SETSPRITERESTITUTIONTHRESHOLD_THRESHOLD );
|
||||||
|
break;
|
||||||
|
case FN_GetSpriteAABB: //Sub Procedure
|
||||||
|
rc_getSpriteAABB( GETSPRITEAABB_SPR_ID, &GETSPRITEAABB_X1, &GETSPRITEAABB_Y1, &GETSPRITEAABB_X2, &GETSPRITEAABB_Y2 );
|
||||||
|
break;
|
||||||
|
case FN_SetGravity2D: //Sub Procedure
|
||||||
|
rc_setGravity2D( SETGRAVITY2D_X, SETGRAVITY2D_Y );
|
||||||
|
break;
|
||||||
|
case FN_GetGravity2D: //Sub Procedure
|
||||||
|
rc_getGravity2D( &GETGRAVITY2D_X, &GETGRAVITY2D_Y );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DTimeStep: //Sub Procedure
|
||||||
|
rc_setWorld2DTimeStep( SETWORLD2DTIMESTEP_TS );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DVelocityIterations: //Sub Procedure
|
||||||
|
rc_setWorld2DVelocityIterations( SETWORLD2DVELOCITYITERATIONS_V );
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DPositionIterations: //Sub Procedure
|
||||||
|
rc_setWorld2DPositionIterations( SETWORLD2DPOSITIONITERATIONS_P );
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DTimeStep: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DTimeStep( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DVelocityIterations: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DVelocityIterations( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DPositionIterations: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DPositionIterations( ));
|
||||||
|
break;
|
||||||
|
case FN_SetWorld2DAutoClearForces: //Sub Procedure
|
||||||
|
rc_setWorld2DAutoClearForces( SETWORLD2DAUTOCLEARFORCES_FLAG );
|
||||||
|
break;
|
||||||
|
case FN_GetWorld2DAutoClearForces: //Number Function
|
||||||
|
rc_push_num(rc_getWorld2DAutoClearForces( ));
|
||||||
|
break;
|
||||||
case FN_createDistanceJoint: //Number Function
|
case FN_createDistanceJoint: //Number Function
|
||||||
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
|
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
|
||||||
break;
|
break;
|
||||||
@@ -2567,6 +2621,12 @@ case FN_SetWorld3DMaxSubSteps: //Sub Procedure
|
|||||||
case FN_SetWorld3DTimeStep: //Sub Procedure
|
case FN_SetWorld3DTimeStep: //Sub Procedure
|
||||||
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS );
|
rc_setWorld3DTimeStep( SETWORLD3DTIMESTEP_TS );
|
||||||
break;
|
break;
|
||||||
|
case FN_GetWorld3DMaxSubSteps: //Number Function
|
||||||
|
rc_push_num(rc_getWorld3DMaxSubSteps( ));
|
||||||
|
break;
|
||||||
|
case FN_GetWorld3DTimeStep: //Number Function
|
||||||
|
rc_push_num(rc_getWorld3DTimeStep( ));
|
||||||
|
break;
|
||||||
case FN_startParticleEmitter: //Sub Procedure
|
case FN_startParticleEmitter: //Sub Procedure
|
||||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -767,38 +767,23 @@ bool rc_restoreWindow()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc_setWindowIcon(int slot)
|
void rc_setWindowIcon(int img_id)
|
||||||
{
|
{
|
||||||
SDL_Rect img_rect;
|
if(img_id < 0 || img_id >= rc_image.size())
|
||||||
img_rect.x = 0;
|
return;
|
||||||
img_rect.y = 0;
|
|
||||||
//img_rect.w = rc_image_width[slot];
|
|
||||||
//img_rect.h = rc_image_height[slot];
|
|
||||||
/*
|
|
||||||
if(rc_himage[slot][win_num] != NULL)
|
|
||||||
{
|
|
||||||
//SDL_RendererFlip rf = (SDL_RendererFlip)(SDL_FLIP_VERTICAL);
|
|
||||||
|
|
||||||
SDL_Surface * tmp_surf = SDL_CreateRGBSurface(0, rc_image_width[slot], rc_image_height[slot], 32, 0, 0, 0, 0);
|
if(!rc_image[img_id].image)
|
||||||
SDL_Texture * tmp_tex = SDL_CreateTexture(rc_win_renderer[rc_active_window], rc_pformat->format, SDL_TEXTUREACCESS_TARGET, rc_image_width[slot], rc_image_height[slot]);
|
return;
|
||||||
SDL_SetRenderTarget(rc_win_renderer[rc_active_window],NULL);
|
|
||||||
SDL_RenderCopy(rc_win_renderer[rc_active_window],rc_himage[slot][rc_active_window],NULL,&img_rect);
|
|
||||||
//SDL_RenderCopyEx(rc_win_renderer[rc_active_window],rc_himage[slot][rc_active_window],NULL,NULL,0,NULL,rf);
|
|
||||||
|
|
||||||
SDL_RenderReadPixels(rc_win_renderer[rc_active_window], &img_rect, rc_pformat->format,tmp_surf->pixels,tmp_surf->pitch);
|
SDL_Surface* img_surface = convertTextureToSurface(rc_image[img_id].image);
|
||||||
|
|
||||||
SDL_SetColorKey(tmp_surf,SDL_TRUE,rc_image_colorKey[slot]);
|
if(!img_surface)
|
||||||
|
return;
|
||||||
|
|
||||||
SDL_SetWindowIcon(rc_win[rc_active_window], tmp_surf);
|
SDL_SetColorKey(img_surface,SDL_TRUE,0);
|
||||||
|
SDL_SetWindowIcon(rc_window, img_surface);
|
||||||
|
|
||||||
|
SDL_FreeSurface(img_surface);
|
||||||
if(rc_active_screen >= 0)
|
|
||||||
SDL_SetRenderTarget(rc_win_renderer[rc_active_window], rc_hscreen[rc_active_window][rc_active_screen]);
|
|
||||||
|
|
||||||
SDL_DestroyTexture(tmp_tex);
|
|
||||||
SDL_FreeSurface(tmp_surf);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -583,12 +583,34 @@ class rc_animEndCallBack : public IAnimationEndCallBack
|
|||||||
//std::cout << "animating" << std::endl;
|
//std::cout << "animating" << std::endl;
|
||||||
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*) ref_actor->mesh_node;
|
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*) ref_actor->mesh_node;
|
||||||
int animation = ref_actor->current_animation;
|
int animation = ref_actor->current_animation;
|
||||||
if(animation < 0 || animation >= ref_actor->animation.size())
|
if(animation == RC_ANIMATION_MD2)
|
||||||
|
{
|
||||||
|
int start_frame = node->getStartFrame();
|
||||||
|
int end_frame = node->getEndFrame();
|
||||||
|
node->setFrameLoop(start_frame, end_frame);
|
||||||
|
ref_actor->current_animation_loop++;
|
||||||
|
}
|
||||||
|
else if(animation == RC_ANIMATION_TRANSITION)
|
||||||
|
{
|
||||||
|
//TODO: Transitions are currently broken
|
||||||
|
}
|
||||||
|
else if(animation < 0 || animation >= ref_actor->animation.size())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
int start_frame = ref_actor->animation[animation].start_frame;
|
}
|
||||||
int end_frame = ref_actor->animation[animation].end_frame;
|
else
|
||||||
node->setFrameLoop(start_frame, end_frame);
|
{
|
||||||
ref_actor->current_animation_loop++;
|
if(!ref_actor->animation[animation].active)
|
||||||
|
{
|
||||||
|
ref_actor->isPlaying = false;
|
||||||
|
ref_actor->current_animation_loop = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int start_frame = ref_actor->animation[animation].start_frame;
|
||||||
|
int end_frame = ref_actor->animation[animation].end_frame;
|
||||||
|
node->setFrameLoop(start_frame, end_frame);
|
||||||
|
ref_actor->current_animation_loop++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -897,5 +919,34 @@ void draw2DImage2(irr::video::IVideoDriver *driver, irr::video::ITexture* textur
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SDL_Surface* convertTextureToSurface(irr::video::ITexture* itexture)
|
||||||
|
{
|
||||||
|
Uint32 t_width, t_height;
|
||||||
|
t_width = itexture->getSize().Width;
|
||||||
|
t_height = itexture->getSize().Height;
|
||||||
|
|
||||||
|
SDL_Surface* surface = SDL_CreateRGBSurface(0, t_width, t_height, 32, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
if(surface)
|
||||||
|
{
|
||||||
|
Uint32* surface_pixels = (Uint32*)surface->pixels;
|
||||||
|
|
||||||
|
Uint32* texture_pixels = (Uint32*)rc_canvas[rc_active_canvas].texture->lock();
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for(int y = 0; y < t_height; y++)
|
||||||
|
{
|
||||||
|
for(int x = 0; x < t_width; x++)
|
||||||
|
{
|
||||||
|
surface_pixels[i] = texture_pixels[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rc_canvas[rc_active_canvas].texture->unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
return surface;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // RC_GFX_CORE_H_INCLUDED
|
#endif // RC_GFX_CORE_H_INCLUDED
|
||||||
|
|||||||
@@ -1,12 +1,27 @@
|
|||||||
#ifndef RC_OS_DEFINES_H_INCLUDED
|
#ifndef RC_OS_DEFINES_H_INCLUDED
|
||||||
#define RC_OS_DEFINES_H_INCLUDED
|
#define RC_OS_DEFINES_H_INCLUDED
|
||||||
|
|
||||||
#define RC_LINUX
|
//USED FOR TESTING ONLY
|
||||||
//#define RC_WEB
|
#define RC_TESTING
|
||||||
//#define RC_WINDOWS
|
|
||||||
//#define RC_ANDROID
|
//I am checking Android first since I think it also defines __linux__
|
||||||
//#define RC_MAC
|
|
||||||
//#define RC_IOS
|
#if defined(__ANDROID__)
|
||||||
|
#define RC_ANDROID
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#define RC_LINUX
|
||||||
|
#elif __EMSCRIPTEN__
|
||||||
|
#define RC_WEB
|
||||||
|
#elif defined(_WIN32) || defined(_WIN64)
|
||||||
|
#define RC_WINDOWS
|
||||||
|
#elif defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
|
||||||
|
#include <TargetConditionals.h>
|
||||||
|
#if defined(TARGET_IPHONE_SIMULATOR) || defined(TARGET_OS_IPHONE)
|
||||||
|
#define RC_IOS
|
||||||
|
#else
|
||||||
|
#define RC_MAC
|
||||||
|
#endif // TARGET_IPHONE_SIMULATOR
|
||||||
|
#endif // defined
|
||||||
|
|
||||||
#ifdef RC_WEB
|
#ifdef RC_WEB
|
||||||
#define RC_LINUX
|
#define RC_LINUX
|
||||||
@@ -20,10 +35,13 @@
|
|||||||
|
|
||||||
#ifdef RC_IOS
|
#ifdef RC_IOS
|
||||||
#define RC_MOBILE
|
#define RC_MOBILE
|
||||||
|
#define RC_DRIVER_GLES2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//FOR DEBUG PURPOSES
|
//FOR TESTING PURPOSES
|
||||||
|
#ifdef RC_TESTING
|
||||||
//#define RC_DRIVER_GLES2
|
//#define RC_DRIVER_GLES2
|
||||||
|
#endif // RC_TESTING
|
||||||
|
|
||||||
#define RC_PI 3.14159265359
|
#define RC_PI 3.14159265359
|
||||||
|
|
||||||
|
|||||||
@@ -32,4 +32,14 @@ void rc_setWorld3DTimeStep(double ts)
|
|||||||
rc_physics3D.fixedTimeStep = ts;
|
rc_physics3D.fixedTimeStep = ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double rc_getWorld3DMaxSubSteps()
|
||||||
|
{
|
||||||
|
return rc_physics3D.maxSubSteps;
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getWorld3DTimeStep()
|
||||||
|
{
|
||||||
|
return rc_physics3D.fixedTimeStep;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // RC_PHYSICS3D_BASE_H_INCLUDED
|
#endif // RC_PHYSICS3D_BASE_H_INCLUDED
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ void rc_setSpriteAngularVelocity(int spr_id, double av)
|
|||||||
if(!rc_sprite[spr_id].active)
|
if(!rc_sprite[spr_id].active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
av = rc_util_radians(av);
|
||||||
|
|
||||||
rc_sprite[spr_id].physics.body->SetAngularVelocity(av);
|
rc_sprite[spr_id].physics.body->SetAngularVelocity(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ double rc_getSpriteAngularVelocity(int spr_id)
|
|||||||
if(!rc_sprite[spr_id].active)
|
if(!rc_sprite[spr_id].active)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (double)rc_sprite[spr_id].physics.body->GetAngularVelocity();
|
return (double)rc_util_degrees(rc_sprite[spr_id].physics.body->GetAngularVelocity());
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc_applySpriteForce(int spr_id, double fX, double fY, double pX, double pY)
|
void rc_applySpriteForce(int spr_id, double fX, double fY, double pX, double pY)
|
||||||
@@ -365,3 +367,211 @@ bool rc_spriteIsFixedRotation(int spr_id)
|
|||||||
|
|
||||||
return rc_sprite[spr_id].physics.body->IsFixedRotation();
|
return rc_sprite[spr_id].physics.body->IsFixedRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void rc_setSpriteDensity( int spr_id, double density )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_sprite[spr_id].physics.fixture->SetDensity(density);
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getSpriteDensity( int spr_id )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_sprite[spr_id].physics.fixture->GetDensity();
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setSpriteFriction( int spr_id, double friction )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_sprite[spr_id].physics.fixture->SetFriction(friction);
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getSpriteFriction( int spr_id )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_sprite[spr_id].physics.fixture->GetFriction();
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setSpriteRestitution( int spr_id, double restitution )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_sprite[spr_id].physics.fixture->SetRestitution(restitution);
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getSpriteRestitution( int spr_id )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_sprite[spr_id].physics.fixture->GetRestitution();
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setSpriteRestitutionThreshold( int spr_id, double threshold )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_sprite[spr_id].physics.fixture->SetRestitutionThreshold(threshold);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_getSpriteAABB( int spr_id, double* x1, double* y1, double* x2, double* y2 )
|
||||||
|
{
|
||||||
|
if(spr_id < 0 || spr_id >= rc_sprite.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!rc_sprite[spr_id].active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
b2AABB bound_box = rc_sprite[spr_id].physics.fixture->GetAABB(0);
|
||||||
|
*x1 = bound_box.upperBound.x;
|
||||||
|
*y1 = bound_box.upperBound.y;
|
||||||
|
*x2 = bound_box.lowerBound.x;
|
||||||
|
*y2 = bound_box.lowerBound.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setWorld2DTimeStep( double ts )
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_canvas[rc_active_canvas].physics2D.timeStep = ts;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setWorld2DVelocityIterations( double v )
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_canvas[rc_active_canvas].physics2D.velocityIterations = (int)v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setWorld2DPositionIterations( double p )
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_canvas[rc_active_canvas].physics2D.positionIterations = (int)p;
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getWorld2DTimeStep()
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_canvas[rc_active_canvas].physics2D.timeStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getWorld2DVelocityIterations()
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_canvas[rc_active_canvas].physics2D.velocityIterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
double rc_getWorld2DPositionIterations()
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc_canvas[rc_active_canvas].physics2D.positionIterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_setWorld2DAutoClearForces( bool flag )
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc_canvas[rc_active_canvas].physics2D.world->SetAutoClearForces(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rc_getWorld2DAutoClearForces()
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return rc_canvas[rc_active_canvas].physics2D.world->GetAutoClearForces();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void rc_setGravity2D(double x, double y)
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
b2Vec2 gravity(x, y);
|
||||||
|
rc_canvas[rc_active_canvas].physics2D.world->SetGravity(gravity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void rc_getGravity2D(double* x, double* y)
|
||||||
|
{
|
||||||
|
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(rc_canvas[rc_active_canvas].type != RC_CANVAS_TYPE_SPRITE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
*x = rc_canvas[rc_active_canvas].physics2D.world->GetGravity().x;
|
||||||
|
*y = rc_canvas[rc_active_canvas].physics2D.world->GetGravity().y;
|
||||||
|
}
|
||||||
|
|||||||
@@ -797,7 +797,6 @@ bool rc_spriteIsVisible(int spr_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------PHYSICS----------------------------------------------------------------------------------
|
//-----------------------------------PHYSICS----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# depslib dependency file v1.0
|
# depslib dependency file v1.0
|
||||||
1731339939 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp
|
1731729523 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp
|
||||||
"rc_os_defines.h"
|
"rc_os_defines.h"
|
||||||
<emscripten.h>
|
<emscripten.h>
|
||||||
<sys/param.h>
|
<sys/param.h>
|
||||||
@@ -32,9 +32,10 @@
|
|||||||
<irrtheora.h>
|
<irrtheora.h>
|
||||||
"rc_func130_cases.h"
|
"rc_func130_cases.h"
|
||||||
|
|
||||||
1731678428 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h
|
1731728855 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h
|
||||||
|
<TargetConditionals.h>
|
||||||
|
|
||||||
1730315467 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h
|
1731722537 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_stdlib.h
|
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_stdlib.h
|
||||||
"rc_os_defines.h"
|
"rc_os_defines.h"
|
||||||
@@ -1246,7 +1247,7 @@
|
|||||||
1727545973 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/RealisticWater.h
|
1727545973 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/RealisticWater.h
|
||||||
<irrlicht.h>
|
<irrlicht.h>
|
||||||
|
|
||||||
1731541468 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx.h
|
1731729912 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx.h
|
||||||
"SDL.h"
|
"SDL.h"
|
||||||
<SDL2/SDL.h>
|
<SDL2/SDL.h>
|
||||||
<irrlicht.h>
|
<irrlicht.h>
|
||||||
@@ -1270,7 +1271,7 @@
|
|||||||
"rc_joints.h"
|
"rc_joints.h"
|
||||||
<irrtheora.h>
|
<irrtheora.h>
|
||||||
|
|
||||||
1731249956 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx_core.h
|
1731727404 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx_core.h
|
||||||
"SDL.h"
|
"SDL.h"
|
||||||
"btBulletDynamicsCommon.h"
|
"btBulletDynamicsCommon.h"
|
||||||
"BulletSoftBody/btSoftRigidDynamicsWorld.h"
|
"BulletSoftBody/btSoftRigidDynamicsWorld.h"
|
||||||
@@ -2271,7 +2272,7 @@
|
|||||||
"rc_gfx_core.h"
|
"rc_gfx_core.h"
|
||||||
<irrtheora.h>
|
<irrtheora.h>
|
||||||
|
|
||||||
1730315467 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h
|
1731722537 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h
|
||||||
|
|
||||||
1724469097 source:/home/n00b/Projects/irrBullet/src/irrBullet.cpp
|
1724469097 source:/home/n00b/Projects/irrBullet/src/irrBullet.cpp
|
||||||
"irrBullet.h"
|
"irrBullet.h"
|
||||||
@@ -2486,7 +2487,7 @@
|
|||||||
<irrlicht.h>
|
<irrlicht.h>
|
||||||
<cmath>
|
<cmath>
|
||||||
|
|
||||||
1731679477 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_spritelib.h
|
1731722537 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_spritelib.h
|
||||||
"SDL.h"
|
"SDL.h"
|
||||||
<SDL2/SDL.h>
|
<SDL2/SDL.h>
|
||||||
"rc_sprite2D.h"
|
"rc_sprite2D.h"
|
||||||
@@ -2504,7 +2505,7 @@
|
|||||||
<irrlicht.h>
|
<irrlicht.h>
|
||||||
<vector>
|
<vector>
|
||||||
|
|
||||||
1730168962 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_sprite_physics.h
|
1731722537 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_sprite_physics.h
|
||||||
"rc_sprite2D.h"
|
"rc_sprite2D.h"
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_joints.h
|
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_joints.h
|
||||||
@@ -2513,14 +2514,14 @@
|
|||||||
"rc_sprite2D.h"
|
"rc_sprite2D.h"
|
||||||
"rc_gfx_core.h"
|
"rc_gfx_core.h"
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_physics3D_base.h
|
1731722537 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_physics3D_base.h
|
||||||
"rc_gfx_core.h"
|
"rc_gfx_core.h"
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
|
1731727404 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
|
1731710840 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_animation.h
|
1731727068 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_animation.h
|
||||||
|
|
||||||
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_physics.h
|
1730291453 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_physics.h
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user