Difference between revisions of "R3d.World"
m (reordering of functions) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
<!-- GIDEROSOBJ:r3d.World --> | <!-- GIDEROSOBJ:r3d.World --> | ||
− | ''' | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
− | ''' | + | '''Available since:''' Gideros 2019.10<br/> |
− | === | + | === Description === |
A dynamics world is used to automatically simulate the motion of your bodies using the world physics. | A dynamics world is used to automatically simulate the motion of your bodies using the world physics. | ||
Line 16: | Line 15: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Methods === |
− | [[ | + | [[r3d.World.new]] ''creates a new world''<br/><!--GIDEROSMTD:r3d.World.new(gravityX,gravityY,gravityZ) creates a 3D physics world--> |
− | <!-- GIDEROSMTD:r3d.World.new(gravityX,gravityY,gravityZ) creates a 3D physics world --> | + | |
− | [[ | + | [[r3d.World:createBallAndSocketJoint]] ''creates a ball and socket joint''<br/><!--GIDEROSMTD:r3d.World:createBallAndSocketJoint(bodyA,bodyB,anchorX,anchorY,anchorZ,params) creates a ball and socket joint--> |
− | <!-- GIDEROSMTD:r3d.World:createBody(transform) creates a new body --> | + | [[r3d.World:createBody]] ''creates a new body''<br/><!--GIDEROSMTD:r3d.World:createBody(transform) creates a new body--> |
− | [[ | + | [[r3d.World:createFixedJoint]] ''creates a fixed joint''<br/><!--GIDEROSMTD:r3d.World:createFixedJoint(bodyA,bodyB,anchorX,anchorY,anchorZ,params) creates a fixed joint--> |
− | <!-- GIDEROSMTD:r3d.World: | + | [[r3d.World:createHingeJoint]] ''creates a hinge joint''<br/><!--GIDEROSMTD:r3d.World:createHingeJoint(bodyA,bodyB,anchorX,anchorY,anchorZ,axisX,axisY,axisZ,params) creates a hinge joint--> |
− | [[ | + | [[r3d.World:createSliderJoint]] ''creates a slider joint''<br/><!--GIDEROSMTD:r3d.World:createSliderJoint(bodyA,bodyB,anchorX,anchorY,anchorZ,axisX,axisY,axisZ,params) creates a slider joint--> |
− | <!-- GIDEROSMTD:r3d.World: | + | [[r3d.World:destroyBody]] ''destroys a body''<br/><!--GIDEROSMTD:r3d.World:destroyBody(body) destroys a body--> |
− | [[ | + | [[r3d.World:destroyJoint]] ''destroys a joint''<br/><!--GIDEROSMTD:r3d.World:destroyBody(joint) destroys a joint--> |
− | <!-- GIDEROSMTD:r3d.World: | + | [[r3d.World:raycast]] ''performs a ray cast on the world''<br/><!--GIDEROSMTD:r3d.World:raycast(sx,sy,sz,ex,ey,ez,callback,category) performs a ray cast on the world--> |
− | [[ | + | [[r3d.World:setEventListener]] ''sets the event listener for collisions in the world''<br/><!--GIDEROSMTD:r3d.World:setEventListener(listener) sets the event listener for collisions in the world--> |
− | <!-- GIDEROSMTD:r3d.World: | + | [[r3d.World:step]] ''steps the world''<br/><!--GIDEROSMTD:r3d.World:step(time) steps the world--> |
− | [[ | + | [[r3d.World:testAABBOverlap]] ''checks if two bodies AABB overlap''<br/><!--GIDEROSMTD:r3d.World:testAABBOverlap(bodyA,bodyB) checks if two bodies AABB overlap--> |
− | <!-- GIDEROSMTD:r3d.World: | + | [[r3d.World:testCollision]] ''checks collisions''<br/><!--GIDEROSMTD:r3d.World:testCollision([bodyA,[bodyB,]]callback[,category]) checks collisions--> |
− | [[ | + | [[r3d.World:testOverlap]] ''checks if two bodies overlap''<br/><!--GIDEROSMTD:r3d.World:testOverlap(bodyA,bodyB) checks if two bodies overlap--> |
− | <!-- GIDEROSMTD:r3d.World: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:r3d.World:setEventListener(listener) sets the event listener for collisions in the world --> | ||
− | [[ | ||
− | <!-- GIDEROSMTD:r3d.World: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:r3d.World: | ||
− | [[ | ||
− | <!-- GIDEROSMTD:r3d.World: | ||
− | |||
− | |||
− | [[ | ||
− | <!-- GIDEROSMTD:r3d.World: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
+ | |} | ||
− | + | ---- | |
+ | '''[[ReactPhysics3D]]''' |
Latest revision as of 19:12, 15 April 2022
Supported platforms:
Available since: Gideros 2019.10
Description
A dynamics world is used to automatically simulate the motion of your bodies using the world physics.
Bodies will be automatically moved using collisions, joints and forces. You do not have to move the bodies manually (but you still can if needed).
The dynamics world will contain the bodies and joints that you create. You will then be able to run your simulation across time by updating the world at each frame.
The DynamicsWorld class (which inherits from the CollisionWorld class) represents a dynamics world in the ReactPhysics3D library.
Methodsr3d.World.new creates a new world r3d.World:createBallAndSocketJoint creates a ball and socket joint |