Difference between revisions of "R3d.Body"
(remove language stuff) |
(wip) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- GIDEROSOBJ:r3d.Body --> | <!-- GIDEROSOBJ:r3d.Body --> | ||
| − | '''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/> | + | '''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]][[File:Platform linux.png]]<br/> |
'''Available since:''' Gideros 2019.10<br/> | '''Available since:''' Gideros 2019.10<br/> | ||
| Line 17: | Line 17: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Methods === | === Methods === | ||
| − | [[r3d.Body: | + | [[r3d.Body:applyLocalForceAtCenterOfMass]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyLocalForceAtCenterOfMass(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> |
| − | [[r3d.Body: | + | [[r3d.Body:applyLocalForceAtLocalPosition]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyLocalForceAtLocalPosition(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> |
| + | [[r3d.Body:applyLocalForceAtWorldPosition]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyLocalForceAtWorldPosition(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> | ||
| + | [[r3d.Body:applyLocalTorque]] ''applies a torque to this body''<br/><!--GIDEROSMTD:r3d.Body:applyLocalTorque(torqueX,torqueY,torqueZ) applies a torque to this body--> | ||
| + | [[r3d.Body:applyWorldForceAtCenterOfMass]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyWorldForceAtCenterOfMass(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> | ||
| + | [[r3d.Body:applyWorldForceAtLocalPosition]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyWorldForceAtLocalPosition(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> | ||
| + | [[r3d.Body:applyWorldForceAtWorldPosition]] ''applies a force to this body''<br/><!--GIDEROSMTD:r3d.Body:applyWorldForceAtWorldPosition(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body--> | ||
| + | [[r3d.Body:applyWorldTorque]] ''applies a torque to this body''<br/><!--GIDEROSMTD:r3d.Body:applyWorldTorque(torqueX,torqueY,torqueZ) applies a torque to this body--> | ||
[[r3d.Body:createFixture]] ''creates a new fixture''<br/><!--GIDEROSMTD:r3d.Body:createFixture(shape,transform,mass) creates a new fixture--> | [[r3d.Body:createFixture]] ''creates a new fixture''<br/><!--GIDEROSMTD:r3d.Body:createFixture(shape,transform,mass) creates a new fixture--> | ||
[[r3d.Body:destroyFixture]] ''destroys a fixture''<br/><!--GIDEROSMTD:r3d.Body:destroyFixture(fixture) destroys a fixture--> | [[r3d.Body:destroyFixture]] ''destroys a fixture''<br/><!--GIDEROSMTD:r3d.Body:destroyFixture(fixture) destroys a fixture--> | ||
| Line 27: | Line 33: | ||
[[r3d.Body:getLinearVelocity]] ''gets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:getLinearVelocity() gets the body linear velocity--> | [[r3d.Body:getLinearVelocity]] ''gets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:getLinearVelocity() gets the body linear velocity--> | ||
[[r3d.Body:getMass]] ''gets the body mass''<br/><!--GIDEROSMTD:r3d.Body:getMass() gets the body mass--> | [[r3d.Body:getMass]] ''gets the body mass''<br/><!--GIDEROSMTD:r3d.Body:getMass() gets the body mass--> | ||
| − | |||
[[r3d.Body:getTransform]] ''gets the body transform (position and rotation) matrix''<br/><!--GIDEROSMTD:r3d.Body:getTransform() gets the body transform (position and rotation) matrix--> | [[r3d.Body:getTransform]] ''gets the body transform (position and rotation) matrix''<br/><!--GIDEROSMTD:r3d.Body:getTransform() gets the body transform (position and rotation) matrix--> | ||
[[r3d.Body:raycast]] ''performs a ray cast on the body''<br/><!--GIDEROSMTD:r3d.Body:raycast(sx,sy,sz,ex,ey,ez) performs a ray cast on the body--> | [[r3d.Body:raycast]] ''performs a ray cast on the body''<br/><!--GIDEROSMTD:r3d.Body:raycast(sx,sy,sz,ex,ey,ez) performs a ray cast on the body--> | ||
| Line 36: | Line 41: | ||
[[r3d.Body:setLinearVelocity]] ''sets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:setLinearVelocity(number) sets the body linear velocity--> | [[r3d.Body:setLinearVelocity]] ''sets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:setLinearVelocity(number) sets the body linear velocity--> | ||
[[r3d.Body:setMass]] ''sets the mass of the body''<br/><!--GIDEROSMTD:r3d.Body:setMass(number) sets the mass of the body--> | [[r3d.Body:setMass]] ''sets the mass of the body''<br/><!--GIDEROSMTD:r3d.Body:setMass(number) sets the mass of the body--> | ||
| − | |||
[[r3d.Body:setTransform]] ''sets the body transform matrix''<br/><!--GIDEROSMTD:r3d.Body:setTransform(transform) sets the body transform matrix--> | [[r3d.Body:setTransform]] ''sets the body transform matrix''<br/><!--GIDEROSMTD:r3d.Body:setTransform(transform) sets the body transform matrix--> | ||
[[r3d.Body:setType]] ''sets the body type''<br/><!--GIDEROSMTD:r3d.Body:setType(type) sets the body type--> | [[r3d.Body:setType]] ''sets the body type''<br/><!--GIDEROSMTD:r3d.Body:setType(type) sets the body type--> | ||
Latest revision as of 12:14, 16 December 2025
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2019.10
Description
Once the dynamics world has been created, you can create rigid bodies into the world.
A rigid body represents an object that you want to simulate in the world. It has a mass, a position, an orientation, a type, and one or several collision shapes. You can also create joints between the bodies in the world.
The dynamics world will compute collisions between the bodies and will update the bodies position and orientation accordingly every time step.
In ReactPhysics3D, the RigidBody class (which inherits from the CollisionBody class) is used to describe a rigid body.
Methodsr3d.Body:applyLocalForceAtCenterOfMass applies a force to this body |
Constantsr3d.Body.STATIC_BODY |