Added new physics functions

* Added some new physics functions
* Added new documentation
* Added some auto checks for OS to rc_os_defines.h
* Fixed bugs on settting and getting position of sprites
This commit is contained in:
n00b
2024-11-15 20:42:08 -05:00
parent 3f4a1ce1cc
commit 40ca65cb3f
37 changed files with 1652 additions and 987 deletions

View 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

View 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

View 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

View File

@@ -0,0 +1,7 @@
#title GetSpriteFriction [RCBasic Doc]
#header function GetSpriteFriction( spr_id )
Returns a sprite's friction
#ref GetSpriteFriction

View File

@@ -0,0 +1,6 @@
#title GetSpriteRestitution [RCBasic Doc]
#header function GetSpriteRestitution( spr_id )
Returns the restitution coefficient for a sprite
#ref SetSpriteRestitution

View File

@@ -0,0 +1,6 @@
#title GetSpriteRestitutionThreshold [RCBasic Doc]
#header function GetSpriteRestitutionThreshold( spr_id )
Returns the restitution velocity threshold for a sprite
#ref SetSpriteRestitutionThreshold

View File

@@ -0,0 +1,6 @@
#title GetWorld2DAutoClearForces [RCBasic Doc]
#header function GetWorld2DAutoClearForces()
Returns the auto clear forces flag for the active canvas
#ref SetWorld2DAutoClearForces

View 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

View File

@@ -0,0 +1,6 @@
#title GetWorld2DTimeStep [RCBasic Doc]
#header function GetWorld2DTimeStep()
Returns the timestep for the active canvas
#ref SetWorld2DTimeStep

View 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

View File

@@ -0,0 +1,5 @@
#title GetWorld3DMaxSubSteps [RCBasic Doc]
#header function GetWorld3DMaxSubSteps()
Returns the maximum substeps in the 3d physics time step

View File

@@ -0,0 +1,4 @@
#title GetWorld3DTimeStep [RCBasic Doc]
#header function GetWorld3DTimeStep()
Returns the timestep of the 3d physics simulation

View 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

View File

@@ -0,0 +1,6 @@
#title SetSpriteFriction [RCBasic Doc]
#header sub SetSpriteFriction( spr_id, friction )
Sets a sprite's friction
#ref GetSpriteFriction

View File

@@ -0,0 +1,7 @@
#title SetSpriteRestitution [RCBasic Doc]
#header sub SetSpriteRestitution( spr_id, restitution )
Sets the restitution coefficient for a sprite
#ref GetSpriteRestitution

View File

@@ -0,0 +1,6 @@
#title SetSpriteRestitutionThreshold [RCBasic Doc]
#header sub SetSpriteRestitutionThreshold( spr_id, threshold )
Sets the restitution threshold for a sprite.
#ref GetSpriteRestitutionThreshold

View 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

View 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

View File

@@ -0,0 +1,6 @@
#title SetWorld2DTimeStep [RCBasic Doc]
#header sub SetWorld2DTimeStep( ts )
Sets the timestep for the active canvas
#ref GetWorld2DTimeStep

View 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