3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create primitive or convex-hull shapes with the new*Shape APIs. 更多...
#include <Body3D.h>
Public 成员函数 | |
| Body3D (World3D *world, b3BodyId bodyId, int id, PhysicsBodyHandle runtimeHandle) | |
| Internal: wraps a Box3D body (use World3D::newBody). | |
| ~Body3D () | |
| Body 3 d. | |
| Body3D (const Body3D &)=delete | |
| Body3D & | operator= (const Body3D &)=delete |
| int | getId () const |
| Stable id used by collision events. | |
| void | setPosition (float x, float y, float z) |
| Position in meters. | |
| float | getX () const |
| Returns the x. | |
| float | getY () const |
| Returns the y. | |
| float | getZ () const |
| Returns the z. | |
| void | setRotation (float qx, float qy, float qz, float qw) |
| Orientation as quaternion (x, y, z, w). | |
| float | getRotX () const |
| Returns the rot x. | |
| float | getRotY () const |
| Returns the rot y. | |
| float | getRotZ () const |
| Returns the rot z. | |
| float | getRotW () const |
| Returns the rot w. | |
| void | setLinearVelocity (float vx, float vy, float vz) |
| Linear velocity in m/s. | |
| float | getLinearVelocityX () const |
| Returns the linear velocity x. | |
| float | getLinearVelocityY () const |
| Returns the linear velocity y. | |
| float | getLinearVelocityZ () const |
| Returns the linear velocity z. | |
| float | getMass () const |
| Body mass in kg. | |
| void | setAngularVelocity (float wx, float wy, float wz) |
| Angular velocity in rad/s. | |
| float | getAngularVelocityX () const |
| Returns the angular velocity x. | |
| float | getAngularVelocityY () const |
| Returns the angular velocity y. | |
| float | getAngularVelocityZ () const |
| Returns the angular velocity z. | |
| std::vector< float > | localToWorldPoint (float x, float y, float z) const |
| Converts a body-local point to world coordinates; returns {x,y,z}. | |
| eve::Result< PhysicsVector3D > | localToWorldPointOwned (float x, float y, float z) const |
| Converts a local point to an allocation-free owning value with structured stale/input failure. | |
| std::vector< float > | worldToLocalPoint (float x, float y, float z) const |
| Converts a world point to body-local coordinates; returns {x,y,z}. | |
| eve::Result< PhysicsVector3D > | worldToLocalPointOwned (float x, float y, float z) const |
| Converts a world point to an allocation-free owning value with structured stale/input failure. | |
| std::vector< float > | localToWorldVector (float x, float y, float z) const |
| Rotates a body-local direction/vector into world space; returns {x,y,z}. | |
| eve::Result< PhysicsVector3D > | localToWorldVectorOwned (float x, float y, float z) const |
| Rotates a local vector into an allocation-free owning world vector. | |
| std::vector< float > | worldToLocalVector (float x, float y, float z) const |
| Rotates a world direction/vector into body-local space; returns {x,y,z}. | |
| std::vector< float > | getLocalPointVelocity (float x, float y, float z) const |
| World-space velocity at a point expressed in body-local coordinates. | |
| eve::Result< PhysicsVector3D > | getLocalPointVelocityOwned (float x, float y, float z) const |
| Returns allocation-free world velocity at a body-local point. | |
| std::vector< float > | getWorldPointVelocity (float x, float y, float z) const |
| World-space velocity at the supplied world point. | |
| void | applyForce (float fx, float fy, float fz) |
| Force applied at the center of mass. | |
| void | applyForceAt (float fx, float fy, float fz, float x, float y, float z) |
| Force applied at a world position. | |
| void | applyTorque (float tx, float ty, float tz) |
| Torque applied in world space. | |
| void | applyLinearImpulse (float ix, float iy, float iz) |
| Instantaneous linear impulse. | |
| void | applyLinearImpulseAt (float ix, float iy, float iz, float x, float y, float z) |
| Instantaneous linear impulse applied at a world position. | |
| void | applyAngularImpulse (float ix, float iy, float iz) |
| Instantaneous angular impulse. | |
| void | applyLocalForce (float fx, float fy, float fz, float x, float y, float z) |
| Body-local force applied at a body-local point. | |
| void | applyLocalForceToCenter (float fx, float fy, float fz) |
| Body-local force applied at the center of mass. | |
| void | applyLocalTorque (float tx, float ty, float tz) |
| Body-local torque. | |
| void | applyLocalLinearImpulse (float ix, float iy, float iz, float x, float y, float z) |
| Body-local linear impulse applied at a body-local point. | |
| void | applyLocalLinearImpulseToCenter (float ix, float iy, float iz) |
| Body-local linear impulse applied at the center of mass. | |
| void | applyLocalAngularImpulse (float ix, float iy, float iz) |
| Body-local angular impulse. | |
| void | setTargetTransform (float x, float y, float z, float qx, float qy, float qz, float qw, float timeStep) |
| Drives a kinematic body to a target pose over a positive time step. The target quaternion is normalized internally. | |
| void | setLinearDamping (float damping) |
| Linear damping coefficient, finite and non-negative. | |
| float | getLinearDamping () const |
| Current linear damping coefficient. | |
| void | setAngularDamping (float damping) |
| Angular damping coefficient, finite and non-negative. | |
| float | getAngularDamping () const |
| Current angular damping coefficient. | |
| void | setGravityScale (float scale) |
| Multiplier applied to world gravity; may be negative. | |
| float | getGravityScale () const |
| Current world-gravity multiplier. | |
| void | setSleepEnabled (bool enabled) |
| Enables or disables automatic sleeping for this body. | |
| bool | isSleepEnabled () const |
| Whether automatic sleeping is enabled. | |
| void | setSleepThreshold (float threshold) |
| Sleep velocity threshold, finite and non-negative. | |
| float | getSleepThreshold () const |
| Current sleep velocity threshold. | |
| void | setMotionLocks (bool linearX, bool linearY, bool linearZ, bool angularX, bool angularY, bool angularZ) |
| Atomically locks translation and rotation on individual local solver axes. | |
| bool | isLinearXLocked () const |
| Whether translation along X is locked. | |
| bool | isLinearYLocked () const |
| Whether translation along Y is locked. | |
| bool | isLinearZLocked () const |
| Whether translation along Z is locked. | |
| bool | isAngularXLocked () const |
| Whether rotation around X is locked. | |
| bool | isAngularYLocked () const |
| Whether rotation around Y is locked. | |
| bool | isAngularZLocked () const |
| Whether rotation around Z is locked. | |
| void | setMassProperties (float mass, float centerX, float centerY, float centerZ, float inertiaXX, float inertiaYY, float inertiaZZ, float inertiaXY=0.f, float inertiaXZ=0.f, float inertiaYZ=0.f) |
| Overrides mass, local center of mass, and the symmetric local inertia tensor. | |
| void | resetMassProperties () |
| Restores automatic mass, center, and inertia calculation from attached shapes. | |
| float | getInertiaXX () const |
| Local inertia tensor XX component about the center of mass. | |
| float | getInertiaYY () const |
| Local inertia tensor YY component about the center of mass. | |
| float | getInertiaZZ () const |
| Local inertia tensor ZZ component about the center of mass. | |
| float | getInertiaXY () const |
| Local symmetric inertia tensor XY component. | |
| float | getInertiaXZ () const |
| Local symmetric inertia tensor XZ component. | |
| float | getInertiaYZ () const |
| Local symmetric inertia tensor YZ component. | |
| float | getLocalCenterX () const |
| Local center of mass X coordinate. | |
| float | getLocalCenterY () const |
| Local center of mass Y coordinate. | |
| float | getLocalCenterZ () const |
| Local center of mass Z coordinate. | |
| float | getWorldCenterX () const |
| World center of mass X coordinate. | |
| float | getWorldCenterY () const |
| World center of mass Y coordinate. | |
| float | getWorldCenterZ () const |
| World center of mass Z coordinate. | |
| void | setType (const std::string &bodyType) |
| "static" | "kinematic" | "dynamic". | |
| std::string | getType () const |
| Returns the type. | |
| void | setFixedRotation (bool fixed) |
| Lock all angular axes (Box3D motion locks). | |
| bool | isFixedRotation () const |
| True when fixed rotation. | |
| void | setActive (bool active) |
| Disables/enables the body and its shapes. | |
| bool | isActive () const |
| True when active. | |
| void | setBullet (bool bullet) |
| CCD bullet mode. | |
| bool | isBullet () const |
| True when bullet. | |
| void | setAwake (bool awake) |
| Wakes / sleeps the body manually. | |
| bool | isAwake () const |
| True when awake. | |
| Shape3D * | newBoxShape (float width, float height, float depth, float density=1.f, float friction=0.2f, float restitution=0.f) |
| Creates a box shape in meter-space units. | |
| Shape3D * | newSphereShape (float radius, float density=1.f, float friction=0.2f, float restitution=0.f) |
| Creates a sphere shape in meter-space units. | |
| Shape3D * | newCapsuleShape (float height, float radius, float density=1.f, float friction=0.2f, float restitution=0.f) |
| Creates a capsule along local Y. | |
| Shape3D * | newConvexHullShape (const std::vector< float > &vertices, int maxVertices=64, float density=1.f, float friction=0.2f, float restitution=0.f) |
| Creates a convex hull from packed local XYZ vertices. | |
| Shape3D * | newTriangleMeshShape (const std::vector< float > &vertices, const std::vector< int32_t > &indices, bool weldVertices=true, float weldTolerance=0.001f, bool identifyEdges=true, bool useMedianSplit=false) |
| Creates a static concave triangle-mesh collider from packed arrays. | |
| Shape3D * | newHeightFieldShape (int countX, int countZ, float cellSizeX, float cellSizeZ, const std::vector< float > &heights, float globalMin, float globalMax, bool clockwiseWinding=false) |
| Creates a compressed static height-field collider extending along +X/+Z. | |
| void | destroy () |
| Destroys the body inside its world. | |
| World3D * | getWorld () |
| Returns the owning world, or null after invalidation. | |
| const World3D * | getWorld () const |
| Returns the owning world as a read-only borrowed pointer. | |
| b3BodyId | raw () const |
| Raw. | |
| bool | isValid () const |
| True while the underlying Box3D body is still alive. | |
| PhysicsBodyHandle | runtimeHandle () const noexcept |
| Returns the process-local solver handle used by PhysicsLink. | |
| void | invalidate () |
| Internal: marks the wrapper invalid after world destruction. | |
友元 | |
| struct | WorldSnapshotAccess |
| class | World3D |
| class | Shape3D |
详细描述
3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create primitive or convex-hull shapes with the new*Shape APIs.
构造及析构函数说明
◆ Body3D() [1/2]
| eve::physics::Body3D::Body3D | ( | World3D * | world, |
| b3BodyId | bodyId, | ||
| int | id, | ||
| PhysicsBodyHandle | runtimeHandle | ||
| ) |
Internal: wraps a Box3D body (use World3D::newBody).
在文件 Body3D.cpp 第 187 行定义.
◆ ~Body3D()
| eve::physics::Body3D::~Body3D | ( | ) |
◆ Body3D() [2/2]
|
delete |
成员函数说明
◆ applyAngularImpulse()
| void eve::physics::Body3D::applyAngularImpulse | ( | float | ix, |
| float | iy, | ||
| float | iz | ||
| ) |
◆ applyForce()
| void eve::physics::Body3D::applyForce | ( | float | fx, |
| float | fy, | ||
| float | fz | ||
| ) |
◆ applyForceAt()
| void eve::physics::Body3D::applyForceAt | ( | float | fx, |
| float | fy, | ||
| float | fz, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ applyLinearImpulse()
| void eve::physics::Body3D::applyLinearImpulse | ( | float | ix, |
| float | iy, | ||
| float | iz | ||
| ) |
◆ applyLinearImpulseAt()
| void eve::physics::Body3D::applyLinearImpulseAt | ( | float | ix, |
| float | iy, | ||
| float | iz, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ applyLocalAngularImpulse()
| void eve::physics::Body3D::applyLocalAngularImpulse | ( | float | ix, |
| float | iy, | ||
| float | iz | ||
| ) |
◆ applyLocalForce()
| void eve::physics::Body3D::applyLocalForce | ( | float | fx, |
| float | fy, | ||
| float | fz, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ applyLocalForceToCenter()
| void eve::physics::Body3D::applyLocalForceToCenter | ( | float | fx, |
| float | fy, | ||
| float | fz | ||
| ) |
◆ applyLocalLinearImpulse()
| void eve::physics::Body3D::applyLocalLinearImpulse | ( | float | ix, |
| float | iy, | ||
| float | iz, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ applyLocalLinearImpulseToCenter()
| void eve::physics::Body3D::applyLocalLinearImpulseToCenter | ( | float | ix, |
| float | iy, | ||
| float | iz | ||
| ) |
◆ applyLocalTorque()
| void eve::physics::Body3D::applyLocalTorque | ( | float | tx, |
| float | ty, | ||
| float | tz | ||
| ) |
◆ applyTorque()
| void eve::physics::Body3D::applyTorque | ( | float | tx, |
| float | ty, | ||
| float | tz | ||
| ) |
◆ destroy()
| void eve::physics::Body3D::destroy | ( | ) |
Destroys the body inside its world.
在文件 Body3D.cpp 第 225 行定义.
引用了 eve::physics::World3D::forgetBody(), eve::physics::World3D::forgetJoint(), eve::physics::World3D::forgetShape(), eve::RuntimeHandle< PhysicsBodyHandleTag >::invalid(), invalidate(), isValid(), eve::physics::World3D::isValid() , 以及 s.
◆ getAngularDamping()
| float eve::physics::Body3D::getAngularDamping | ( | ) | const |
◆ getAngularVelocityX()
| float eve::physics::Body3D::getAngularVelocityX | ( | ) | const |
◆ getAngularVelocityY()
| float eve::physics::Body3D::getAngularVelocityY | ( | ) | const |
◆ getAngularVelocityZ()
| float eve::physics::Body3D::getAngularVelocityZ | ( | ) | const |
◆ getGravityScale()
| float eve::physics::Body3D::getGravityScale | ( | ) | const |
◆ getId()
|
inline |
Stable id used by collision events.
被这些函数引用 eve::physics::Joint3D::getBodyAId(), eve::physics::Joint3D::getBodyBId(), eve::physics::World3D::isBodyPairCollisionEnabled(), eve::physics::World3D::queryBodyContacts() , 以及 eve::physics::World3D::setBodyPairCollisionEnabled().
◆ getInertiaXX()
| float eve::physics::Body3D::getInertiaXX | ( | ) | const |
Local inertia tensor XX component about the center of mass.
◆ getInertiaXY()
| float eve::physics::Body3D::getInertiaXY | ( | ) | const |
Local symmetric inertia tensor XY component.
◆ getInertiaXZ()
| float eve::physics::Body3D::getInertiaXZ | ( | ) | const |
Local symmetric inertia tensor XZ component.
◆ getInertiaYY()
| float eve::physics::Body3D::getInertiaYY | ( | ) | const |
Local inertia tensor YY component about the center of mass.
◆ getInertiaYZ()
| float eve::physics::Body3D::getInertiaYZ | ( | ) | const |
Local symmetric inertia tensor YZ component.
◆ getInertiaZZ()
| float eve::physics::Body3D::getInertiaZZ | ( | ) | const |
Local inertia tensor ZZ component about the center of mass.
◆ getLinearDamping()
| float eve::physics::Body3D::getLinearDamping | ( | ) | const |
◆ getLinearVelocityX()
| float eve::physics::Body3D::getLinearVelocityX | ( | ) | const |
◆ getLinearVelocityY()
| float eve::physics::Body3D::getLinearVelocityY | ( | ) | const |
◆ getLinearVelocityZ()
| float eve::physics::Body3D::getLinearVelocityZ | ( | ) | const |
◆ getLocalCenterX()
| float eve::physics::Body3D::getLocalCenterX | ( | ) | const |
Local center of mass X coordinate.
◆ getLocalCenterY()
| float eve::physics::Body3D::getLocalCenterY | ( | ) | const |
Local center of mass Y coordinate.
◆ getLocalCenterZ()
| float eve::physics::Body3D::getLocalCenterZ | ( | ) | const |
Local center of mass Z coordinate.
◆ getLocalPointVelocity()
| std::vector< float > eve::physics::Body3D::getLocalPointVelocity | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ getLocalPointVelocityOwned()
| eve::Result< PhysicsVector3D > eve::physics::Body3D::getLocalPointVelocityOwned | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Returns allocation-free world velocity at a body-local point.
在文件 Body3D.cpp 第 414 行定义.
引用了 eve::Result< T >::failure(), eve::Result< T >::success(), valid, value, x, y , 以及 z.
◆ getMass()
| float eve::physics::Body3D::getMass | ( | ) | const |
◆ getRotW()
| float eve::physics::Body3D::getRotW | ( | ) | const |
◆ getRotX()
| float eve::physics::Body3D::getRotX | ( | ) | const |
◆ getRotY()
| float eve::physics::Body3D::getRotY | ( | ) | const |
◆ getRotZ()
| float eve::physics::Body3D::getRotZ | ( | ) | const |
◆ getSleepThreshold()
| float eve::physics::Body3D::getSleepThreshold | ( | ) | const |
◆ getType()
| std::string eve::physics::Body3D::getType | ( | ) | const |
◆ getWorld() [1/2]
|
inline |
Returns the owning world, or null after invalidation.
- 返回
- Borrowed nullable World3D pointer owned by the physics registry. @ownership Body3D does not own the world; callers must not delete it. @lifetime Valid until world destruction; use PhysicsWorldHandle across frames. @thread Call on the owning physics thread. @reentrancy The accessor invokes no callbacks and is invalid across world mutation.
被这些函数引用 eve::physics::World3D::isBodyPairCollisionEnabled(), eve::physics::World3D::isShapePairCollisionEnabled(), eve::physics::World3D::newDistanceJoint(), eve::physics::World3D::newPrismaticJoint(), eve::physics::World3D::newRevoluteJoint(), eve::physics::World3D::newSphericalJoint(), eve::physics::World3D::newWheelJoint(), eve::physics::World3D::setBodyPairCollisionEnabled() , 以及 eve::physics::World3D::setShapePairCollisionEnabled().
◆ getWorld() [2/2]
|
inline |
Returns the owning world as a read-only borrowed pointer.
- 返回
- Borrowed nullable World3D pointer. @ownership Body3D does not own the world; callers must not delete it. @lifetime Valid until world destruction; use PhysicsWorldHandle across frames. @thread Call on the owning physics thread. @reentrancy The accessor invokes no callbacks and is invalid across world mutation.
◆ getWorldCenterX()
| float eve::physics::Body3D::getWorldCenterX | ( | ) | const |
World center of mass X coordinate.
◆ getWorldCenterY()
| float eve::physics::Body3D::getWorldCenterY | ( | ) | const |
World center of mass Y coordinate.
◆ getWorldCenterZ()
| float eve::physics::Body3D::getWorldCenterZ | ( | ) | const |
World center of mass Z coordinate.
◆ getWorldPointVelocity()
| std::vector< float > eve::physics::Body3D::getWorldPointVelocity | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ getX()
| float eve::physics::Body3D::getX | ( | ) | const |
◆ getY()
| float eve::physics::Body3D::getY | ( | ) | const |
◆ getZ()
| float eve::physics::Body3D::getZ | ( | ) | const |
◆ invalidate()
| void eve::physics::Body3D::invalidate | ( | ) |
Internal: marks the wrapper invalid after world destruction.
在文件 Body3D.cpp 第 218 行定义.
引用了 eve::RuntimeHandle< PhysicsBodyHandleTag >::invalid() , 以及 isValid().
被这些函数引用 destroy().
◆ isActive()
| bool eve::physics::Body3D::isActive | ( | ) | const |
◆ isAngularXLocked()
| bool eve::physics::Body3D::isAngularXLocked | ( | ) | const |
Whether rotation around X is locked.
◆ isAngularYLocked()
| bool eve::physics::Body3D::isAngularYLocked | ( | ) | const |
Whether rotation around Y is locked.
◆ isAngularZLocked()
| bool eve::physics::Body3D::isAngularZLocked | ( | ) | const |
Whether rotation around Z is locked.
◆ isAwake()
| bool eve::physics::Body3D::isAwake | ( | ) | const |
◆ isBullet()
| bool eve::physics::Body3D::isBullet | ( | ) | const |
◆ isFixedRotation()
| bool eve::physics::Body3D::isFixedRotation | ( | ) | const |
◆ isLinearXLocked()
| bool eve::physics::Body3D::isLinearXLocked | ( | ) | const |
Whether translation along X is locked.
◆ isLinearYLocked()
| bool eve::physics::Body3D::isLinearYLocked | ( | ) | const |
Whether translation along Y is locked.
◆ isLinearZLocked()
| bool eve::physics::Body3D::isLinearZLocked | ( | ) | const |
Whether translation along Z is locked.
◆ isSleepEnabled()
| bool eve::physics::Body3D::isSleepEnabled | ( | ) | const |
◆ isValid()
| bool eve::physics::Body3D::isValid | ( | ) | const |
True while the underlying Box3D body is still alive.
在文件 Body3D.cpp 第 216 行定义.
被这些函数引用 applyAngularImpulse(), applyForce(), applyForceAt(), applyLinearImpulse(), applyLinearImpulseAt(), applyLocalAngularImpulse(), applyLocalForce(), applyLocalForceToCenter(), applyLocalLinearImpulse(), applyLocalLinearImpulseToCenter(), applyLocalTorque(), applyTorque(), destroy(), eve::physics::Shape3D::destroy(), getAngularDamping(), getAngularVelocityX(), getAngularVelocityY(), getAngularVelocityZ(), getGravityScale(), getLinearDamping(), getLinearVelocityX(), getLinearVelocityY(), getLinearVelocityZ(), getLocalPointVelocity(), getMass(), getRotW(), getRotX(), getRotY(), getRotZ(), getSleepThreshold(), getType(), getWorldPointVelocity(), getX(), getY(), getZ(), invalidate(), isActive(), isAwake(), eve::physics::World3D::isBodyPairCollisionEnabled(), isBullet(), isFixedRotation(), isSleepEnabled(), localToWorldPoint(), localToWorldVector(), newBoxShape(), newCapsuleShape(), newConvexHullShape(), eve::physics::World3D::newDistanceJoint(), newHeightFieldShape(), eve::physics::World3D::newPrismaticJoint(), eve::physics::World3D::newRevoluteJoint(), newSphereShape(), eve::physics::World3D::newSphericalJoint(), newTriangleMeshShape(), eve::physics::World3D::newWheelJoint(), resetMassProperties(), setActive(), setAngularDamping(), setAngularVelocity(), setAwake(), eve::physics::World3D::setBodyPairCollisionEnabled(), eve::physics::Shape3D::setBoxSize(), setBullet(), eve::physics::Shape3D::setCapsuleSize(), eve::physics::Shape3D::setConvexHullVertices(), eve::physics::Shape3D::setExplosionScale(), setFixedRotation(), setGravityScale(), eve::physics::Shape3D::setHeightFieldHeights(), setLinearDamping(), setLinearVelocity(), eve::physics::Shape3D::setLocalTransform(), setMassProperties(), setMotionLocks(), setPosition(), setRotation(), eve::physics::Shape3D::setSensor(), setSleepEnabled(), setSleepThreshold(), eve::physics::Shape3D::setSphereRadius(), setTargetTransform(), eve::physics::Shape3D::setTriangleMeshData(), setType(), eve::physics::Shape3D::testPoint(), worldToLocalPoint(), worldToLocalVector(), ~Body3D() , 以及 eve::physics::Shape3D::~Shape3D().
◆ localToWorldPoint()
| std::vector< float > eve::physics::Body3D::localToWorldPoint | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ localToWorldPointOwned()
| eve::Result< PhysicsVector3D > eve::physics::Body3D::localToWorldPointOwned | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Converts a local point to an allocation-free owning value with structured stale/input failure.
在文件 Body3D.cpp 第 364 行定义.
引用了 eve::Result< T >::failure(), eve::Result< T >::success(), valid, value, x, y , 以及 z.
◆ localToWorldVector()
| std::vector< float > eve::physics::Body3D::localToWorldVector | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ localToWorldVectorOwned()
| eve::Result< PhysicsVector3D > eve::physics::Body3D::localToWorldVectorOwned | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Rotates a local vector into an allocation-free owning world vector.
在文件 Body3D.cpp 第 393 行定义.
引用了 eve::Result< T >::failure(), eve::Result< T >::success(), valid, value, x, y , 以及 z.
◆ newBoxShape()
| Shape3D * eve::physics::Body3D::newBoxShape | ( | float | width, |
| float | height, | ||
| float | depth, | ||
| float | density = 1.f, |
||
| float | friction = 0.2f, |
||
| float | restitution = 0.f |
||
| ) |
Creates a box shape in meter-space units.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 715 行定义.
引用了 eve::physics::Shape3D::Box, depth, height, isValid(), eve::physics::World3D::nextShapeRuntimeHandle(), restitution, shape, Shape3D , 以及 width.
◆ newCapsuleShape()
| Shape3D * eve::physics::Body3D::newCapsuleShape | ( | float | height, |
| float | radius, | ||
| float | density = 1.f, |
||
| float | friction = 0.2f, |
||
| float | restitution = 0.f |
||
| ) |
Creates a capsule along local Y.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 753 行定义.
引用了 eve::physics::Shape3D::Capsule, height, isValid(), eve::physics::World3D::nextShapeRuntimeHandle(), radius, restitution, shape , 以及 Shape3D.
◆ newConvexHullShape()
| Shape3D * eve::physics::Body3D::newConvexHullShape | ( | const std::vector< float > & | vertices, |
| int | maxVertices = 64, |
||
| float | density = 1.f, |
||
| float | friction = 0.2f, |
||
| float | restitution = 0.f |
||
| ) |
Creates a convex hull from packed local XYZ vertices.
- 参数
-
vertices At least four finite, non-coplanar points (x0,y0,z0,...). maxVertices Hull simplification budget in [4, 254]. density Density in kg/m^3. friction Surface friction. restitution Surface restitution.
- 异常
-
eve::Exception for malformed or degenerate input.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 775 行定义.
引用了 eve::physics::Shape3D::ConvexHull, isValid(), eve::physics::World3D::nextShapeRuntimeHandle(), restitution, shape, Shape3D , 以及 vertices.
◆ newHeightFieldShape()
| Shape3D * eve::physics::Body3D::newHeightFieldShape | ( | int | countX, |
| int | countZ, | ||
| float | cellSizeX, | ||
| float | cellSizeZ, | ||
| const std::vector< float > & | heights, | ||
| float | globalMin, | ||
| float | globalMax, | ||
| bool | clockwiseWinding = false |
||
| ) |
Creates a compressed static height-field collider extending along +X/+Z.
- 参数
-
countX Number of samples along local X, at least two. countZ Number of samples along local Z, at least two. cellSizeX Positive spacing in meters along X. cellSizeZ Positive spacing in meters along Z. heights countX*countZ row-major world-meter heights. globalMin Shared quantization minimum; heights must lie in range. globalMax Shared quantization maximum. clockwiseWinding Inverts the collidable side when true.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 816 行定义.
引用了 eve::physics::Shape3D::HeightField, isValid(), eve::physics::World3D::nextShapeRuntimeHandle(), shape , 以及 Shape3D.
◆ newSphereShape()
| Shape3D * eve::physics::Body3D::newSphereShape | ( | float | radius, |
| float | density = 1.f, |
||
| float | friction = 0.2f, |
||
| float | restitution = 0.f |
||
| ) |
Creates a sphere shape in meter-space units.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 735 行定义.
引用了 isValid(), eve::physics::World3D::nextShapeRuntimeHandle(), radius, restitution, shape, Shape3D , 以及 eve::physics::Shape3D::Sphere.
◆ newTriangleMeshShape()
| Shape3D * eve::physics::Body3D::newTriangleMeshShape | ( | const std::vector< float > & | vertices, |
| const std::vector< int32_t > & | indices, | ||
| bool | weldVertices = true, |
||
| float | weldTolerance = 0.001f, |
||
| bool | identifyEdges = true, |
||
| bool | useMedianSplit = false |
||
| ) |
Creates a static concave triangle-mesh collider from packed arrays.
- 参数
-
vertices Finite local XYZ values. indices Triangle indices, three per counter-clockwise face. weldVertices Whether nearby source vertices are welded. weldTolerance Non-negative weld distance in meters. identifyEdges Whether shared edges are classified for smooth collision. useMedianSplit Faster BVH construction for regular grid-like meshes.
- 异常
-
eve::Exception unless this is a static Body or data is invalid/degenerate.
- 返回
- Borrowed nullable shape owned by this body/world. @ownership The Box3D world owns the shape; callers must destroy it through this API. @lifetime Valid until shape/body/world destruction; use PhysicsShapeHandle across frames. @thread Call on the owning physics thread. @reentrancy Creation does not invoke user callbacks; do not re-enter world mutation while using the result.
在文件 Body3D.cpp 第 791 行定义.
引用了 indices, isValid(), mesh, eve::physics::World3D::nextShapeRuntimeHandle(), shape, Shape3D, eve::physics::Shape3D::TriangleMesh , 以及 vertices.
◆ operator=()
◆ raw()
|
inline |
Raw.
被这些函数引用 eve::physics::World3D::newDistanceJoint(), eve::physics::World3D::newFilterJoint(), eve::physics::World3D::newMotorJoint(), eve::physics::World3D::newParallelJoint(), eve::physics::World3D::newPrismaticJoint(), eve::physics::World3D::newRevoluteJoint(), eve::physics::World3D::newSphericalJoint(), eve::physics::World3D::newWeldJoint(), eve::physics::World3D::newWheelJoint(), eve::physics::Shape3D::setTriangleMeshData() , 以及 eve::physics::Shape3D::testPoint().
◆ resetMassProperties()
| void eve::physics::Body3D::resetMassProperties | ( | ) |
Restores automatic mass, center, and inertia calculation from attached shapes.
在文件 Body3D.cpp 第 627 行定义.
引用了 isValid().
◆ runtimeHandle()
|
inlinenoexcept |
Returns the process-local solver handle used by PhysicsLink.
- 返回
- Generation-qualified handle; it becomes stale on destruction.
◆ setActive()
| void eve::physics::Body3D::setActive | ( | bool | active | ) |
◆ setAngularDamping()
| void eve::physics::Body3D::setAngularDamping | ( | float | damping | ) |
◆ setAngularVelocity()
| void eve::physics::Body3D::setAngularVelocity | ( | float | wx, |
| float | wy, | ||
| float | wz | ||
| ) |
◆ setAwake()
| void eve::physics::Body3D::setAwake | ( | bool | awake | ) |
◆ setBullet()
| void eve::physics::Body3D::setBullet | ( | bool | bullet | ) |
◆ setFixedRotation()
| void eve::physics::Body3D::setFixedRotation | ( | bool | fixed | ) |
◆ setGravityScale()
| void eve::physics::Body3D::setGravityScale | ( | float | scale | ) |
Multiplier applied to world gravity; may be negative.
在文件 Body3D.cpp 第 539 行定义.
◆ setLinearDamping()
| void eve::physics::Body3D::setLinearDamping | ( | float | damping | ) |
◆ setLinearVelocity()
| void eve::physics::Body3D::setLinearVelocity | ( | float | vx, |
| float | vy, | ||
| float | vz | ||
| ) |
◆ setMassProperties()
| void eve::physics::Body3D::setMassProperties | ( | float | mass, |
| float | centerX, | ||
| float | centerY, | ||
| float | centerZ, | ||
| float | inertiaXX, | ||
| float | inertiaYY, | ||
| float | inertiaZZ, | ||
| float | inertiaXY = 0.f, |
||
| float | inertiaXZ = 0.f, |
||
| float | inertiaYZ = 0.f |
||
| ) |
Overrides mass, local center of mass, and the symmetric local inertia tensor.
- 参数
-
mass Positive mass in kilograms. centerX Local center of mass X coordinate. centerY Local center of mass Y coordinate. centerZ Local center of mass Z coordinate. inertiaXX Inertia tensor XX component about the center of mass. inertiaYY Inertia tensor YY component about the center of mass. inertiaZZ Inertia tensor ZZ component about the center of mass. inertiaXY Symmetric inertia tensor XY component. inertiaXZ Symmetric inertia tensor XZ component. inertiaYZ Symmetric inertia tensor YZ component.
- 异常
-
eve::Exception unless the body is dynamic and the tensor is positive definite.
在文件 Body3D.cpp 第 588 行定义.
◆ setMotionLocks()
| void eve::physics::Body3D::setMotionLocks | ( | bool | linearX, |
| bool | linearY, | ||
| bool | linearZ, | ||
| bool | angularX, | ||
| bool | angularY, | ||
| bool | angularZ | ||
| ) |
Atomically locks translation and rotation on individual local solver axes.
在文件 Body3D.cpp 第 568 行定义.
引用了 isValid().
◆ setPosition()
| void eve::physics::Body3D::setPosition | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setRotation()
| void eve::physics::Body3D::setRotation | ( | float | qx, |
| float | qy, | ||
| float | qz, | ||
| float | qw | ||
| ) |
◆ setSleepEnabled()
| void eve::physics::Body3D::setSleepEnabled | ( | bool | enabled | ) |
Enables or disables automatic sleeping for this body.
在文件 Body3D.cpp 第 549 行定义.
◆ setSleepThreshold()
| void eve::physics::Body3D::setSleepThreshold | ( | float | threshold | ) |
◆ setTargetTransform()
| void eve::physics::Body3D::setTargetTransform | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | qx, | ||
| float | qy, | ||
| float | qz, | ||
| float | qw, | ||
| float | timeStep | ||
| ) |
◆ setType()
| void eve::physics::Body3D::setType | ( | const std::string & | bodyType | ) |
"static" | "kinematic" | "dynamic".
在文件 Body3D.cpp 第 656 行定义.
引用了 eve::physics::Shape3D::HeightField, isValid(), shape, eve::physics::Shape3D::TriangleMesh , 以及 type.
被这些函数引用 eve::physics::GeometryCollectionInstance::restoreSnapshot().
◆ worldToLocalPoint()
| std::vector< float > eve::physics::Body3D::worldToLocalPoint | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ worldToLocalPointOwned()
| eve::Result< PhysicsVector3D > eve::physics::Body3D::worldToLocalPointOwned | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Converts a world point to an allocation-free owning value with structured stale/input failure.
在文件 Body3D.cpp 第 379 行定义.
引用了 eve::Result< T >::failure(), eve::Result< T >::success(), valid, value, x, y , 以及 z.
◆ worldToLocalVector()
| std::vector< float > eve::physics::Body3D::worldToLocalVector | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
友元及相关函数文档
◆ Shape3D
|
friend |
◆ World3D
◆ WorldSnapshotAccess
|
friend |
该类的文档由以下文件生成:
- src/modules/physics/Body3D.h
- src/modules/physics/Body3D.cpp