Difference between revisions of "R3d.Body"
Line 17: | Line 17: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Methods === |
[[Special:MyLanguage/r3d.Body:applyForce|r3d.Body:applyForce]] ''<translate>applies a force to this body</translate>''<br/> | [[Special:MyLanguage/r3d.Body:applyForce|r3d.Body:applyForce]] ''<translate>applies a force to this body</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:applyForce(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body --> | <!-- GIDEROSMTD:r3d.Body:applyForce(forceX,forceY,forceZ[,pointX,pointY,pointZ]) applies a force to this body --> | ||
Line 28: | Line 28: | ||
[[Special:MyLanguage/r3d.Body:enableGravity|r3d.Body:enableGravity]] ''<translate>enables or disables gravity force on the body</translate>''<br/> | [[Special:MyLanguage/r3d.Body:enableGravity|r3d.Body:enableGravity]] ''<translate>enables or disables gravity force on the body</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:enableGravity(enable) enables or disables gravity force on the body --> | <!-- GIDEROSMTD:r3d.Body:enableGravity(enable) enables or disables gravity force on the body --> | ||
+ | [[Special:MyLanguage/r3d.Body:getAngularDamping|r3d.Body:getAngularDamping]] ''<translate>gets the body angular damping</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:getAngularDamping() gets the body angular damping --> | ||
+ | [[Special:MyLanguage/r3d.Body:getAngularVelocity|r3d.Body:getAngularVelocity]] ''<translate>gets the body angular velocity</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:getAngularVelocity() gets the body angular velocity --> | ||
+ | [[Special:MyLanguage/r3d.Body:getLinearDamping|r3d.Body:getLinearDamping]] ''<translate>gets the body linear damping</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:getLinearDamping() gets the body linear damping --> | ||
+ | [[Special:MyLanguage/r3d.Body:getLinearVelocity|r3d.Body:getLinearVelocity]] ''<translate>gets the body linear velocity</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:getLinearVelocity() gets the body linear velocity --> | ||
+ | [[Special:MyLanguage/r3d.Body:getMass|r3d.Body:getMass]] ''<translate>gets the body mass</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:getMass() gets the body mass --> | ||
[[Special:MyLanguage/r3d.Body:getMaterial|r3d.Body:getMaterial]] ''<translate>gets the body material</translate>''<br/> | [[Special:MyLanguage/r3d.Body:getMaterial|r3d.Body:getMaterial]] ''<translate>gets the body material</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:getMaterial() gets the body material --> | <!-- GIDEROSMTD:r3d.Body:getMaterial() gets the body material --> | ||
Line 34: | Line 44: | ||
[[Special:MyLanguage/r3d.Body:raycast|r3d.Body:raycast]] ''<translate>performs a ray cast on the body</translate>''<br/> | [[Special:MyLanguage/r3d.Body:raycast|r3d.Body:raycast]] ''<translate>performs a ray cast on the body</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:raycast(sx,sy,sz,ex,ey,ez) performs a ray cast on the body --> | <!-- GIDEROSMTD:r3d.Body:raycast(sx,sy,sz,ex,ey,ez) performs a ray cast on the body --> | ||
+ | [[Special:MyLanguage/r3d.Body:setAngularDamping|r3d.Body:setAngularDamping]] ''<translate>sets the body angular damping</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:setAngularDamping(number) sets the body angular damping --> | ||
+ | [[Special:MyLanguage/r3d.Body:setAngularVelocity|r3d.Body:setAngularVelocity]] ''<translate>sets the body angular velocity</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:setAngularVelocity(number) sets the body angular velocity --> | ||
[[Special:MyLanguage/r3d.Body:setIsAllowedToSleep|r3d.Body:setIsAllowedToSleep]] ''<translate>allows or disallows a body to sleep</translate>''<br/> | [[Special:MyLanguage/r3d.Body:setIsAllowedToSleep|r3d.Body:setIsAllowedToSleep]] ''<translate>allows or disallows a body to sleep</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:setIsAllowedToSleep(allowed) allows or disallows a body to sleep --> | <!-- GIDEROSMTD:r3d.Body:setIsAllowedToSleep(allowed) allows or disallows a body to sleep --> | ||
+ | [[Special:MyLanguage/r3d.Body:setLinearDamping|r3d.Body:setLinearDamping]] ''<translate>sets the body linear damping</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:setLinearDamping(number) sets the body linear damping --> | ||
+ | [[Special:MyLanguage/r3d.Body:setLinearVelocity|r3d.Body:setLinearVelocity]] ''<translate>sets the body linear velocity</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:setLinearVelocity(number) sets the body linear velocity --> | ||
+ | [[Special:MyLanguage/r3d.Body:setMass|r3d.Body:setMass]] ''<translate>sets the body mass</translate>''<br/> | ||
+ | <!-- GIDEROSMTD:r3d.Body:setMass(number) sets the body mass --> | ||
[[Special:MyLanguage/r3d.Body:setMaterial|r3d.Body:setMaterial]] ''<translate>sets the body material</translate>''<br/> | [[Special:MyLanguage/r3d.Body:setMaterial|r3d.Body:setMaterial]] ''<translate>sets the body material</translate>''<br/> | ||
<!-- GIDEROSMTD:r3d.Body:setMaterial(material) sets the body material --> | <!-- GIDEROSMTD:r3d.Body:setMaterial(material) sets the body material --> |
Revision as of 06:38, 10 February 2020
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:applyForce applies a force to this body |
Constantsr3d.Body.STATIC_BODY |