载入中...
搜索中...
未找到
eve::physics::Body3D类 参考

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.h 第 24 行定义.

构造及析构函数说明

◆ 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()

◆ Body3D() [2/2]

eve::physics::Body3D::Body3D ( const Body3D &  )
delete

成员函数说明

◆ applyAngularImpulse()

void eve::physics::Body3D::applyAngularImpulse ( float  ix,
float  iy,
float  iz 
)

Instantaneous angular impulse.

在文件 Body3D.cpp 第 453 行定义.

引用了 isValid().

◆ applyForce()

void eve::physics::Body3D::applyForce ( float  fx,
float  fy,
float  fz 
)

Force applied at the center of mass.

在文件 Body3D.cpp 第 428 行定义.

引用了 isValid().

◆ applyForceAt()

void eve::physics::Body3D::applyForceAt ( float  fx,
float  fy,
float  fz,
float  x,
float  y,
float  z 
)

Force applied at a world position.

在文件 Body3D.cpp 第 433 行定义.

引用了 isValid(), x, y , 以及 z.

◆ applyLinearImpulse()

void eve::physics::Body3D::applyLinearImpulse ( float  ix,
float  iy,
float  iz 
)

Instantaneous linear impulse.

在文件 Body3D.cpp 第 443 行定义.

引用了 isValid().

◆ applyLinearImpulseAt()

void eve::physics::Body3D::applyLinearImpulseAt ( float  ix,
float  iy,
float  iz,
float  x,
float  y,
float  z 
)

Instantaneous linear impulse applied at a world position.

在文件 Body3D.cpp 第 448 行定义.

引用了 isValid(), x, y , 以及 z.

◆ applyLocalAngularImpulse()

void eve::physics::Body3D::applyLocalAngularImpulse ( float  ix,
float  iy,
float  iz 
)

Body-local angular impulse.

在文件 Body3D.cpp 第 497 行定义.

引用了 isValid().

◆ applyLocalForce()

void eve::physics::Body3D::applyLocalForce ( float  fx,
float  fy,
float  fz,
float  x,
float  y,
float  z 
)

Body-local force applied at a body-local point.

在文件 Body3D.cpp 第 458 行定义.

引用了 isValid(), point, x, y , 以及 z.

◆ applyLocalForceToCenter()

void eve::physics::Body3D::applyLocalForceToCenter ( float  fx,
float  fy,
float  fz 
)

Body-local force applied at the center of mass.

在文件 Body3D.cpp 第 467 行定义.

引用了 isValid().

◆ applyLocalLinearImpulse()

void eve::physics::Body3D::applyLocalLinearImpulse ( float  ix,
float  iy,
float  iz,
float  x,
float  y,
float  z 
)

Body-local linear impulse applied at a body-local point.

在文件 Body3D.cpp 第 480 行定义.

引用了 isValid(), point, x, y , 以及 z.

◆ applyLocalLinearImpulseToCenter()

void eve::physics::Body3D::applyLocalLinearImpulseToCenter ( float  ix,
float  iy,
float  iz 
)

Body-local linear impulse applied at the center of mass.

在文件 Body3D.cpp 第 490 行定义.

引用了 isValid().

◆ applyLocalTorque()

void eve::physics::Body3D::applyLocalTorque ( float  tx,
float  ty,
float  tz 
)

Body-local torque.

在文件 Body3D.cpp 第 474 行定义.

引用了 isValid().

◆ applyTorque()

void eve::physics::Body3D::applyTorque ( float  tx,
float  ty,
float  tz 
)

Torque applied in world space.

在文件 Body3D.cpp 第 438 行定义.

引用了 isValid().

◆ destroy()

◆ getAngularDamping()

float eve::physics::Body3D::getAngularDamping ( ) const

Current angular damping coefficient.

在文件 Body3D.cpp 第 535 行定义.

引用了 isValid().

◆ getAngularVelocityX()

float eve::physics::Body3D::getAngularVelocityX ( ) const

Returns the angular velocity x.

在文件 Body3D.cpp 第 341 行定义.

引用了 isValid().

◆ getAngularVelocityY()

float eve::physics::Body3D::getAngularVelocityY ( ) const

Returns the angular velocity y.

在文件 Body3D.cpp 第 346 行定义.

引用了 isValid().

◆ getAngularVelocityZ()

float eve::physics::Body3D::getAngularVelocityZ ( ) const

Returns the angular velocity z.

在文件 Body3D.cpp 第 351 行定义.

引用了 isValid().

◆ getGravityScale()

float eve::physics::Body3D::getGravityScale ( ) const

Current world-gravity multiplier.

在文件 Body3D.cpp 第 545 行定义.

引用了 isValid().

◆ getId()

int eve::physics::Body3D::getId ( ) const
inline

◆ 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

Current linear damping coefficient.

在文件 Body3D.cpp 第 525 行定义.

引用了 isValid().

◆ getLinearVelocityX()

float eve::physics::Body3D::getLinearVelocityX ( ) const

Returns the linear velocity x.

在文件 Body3D.cpp 第 316 行定义.

引用了 isValid().

被这些函数引用 eve::climbing::ClimbingRuntime::advance().

◆ getLinearVelocityY()

float eve::physics::Body3D::getLinearVelocityY ( ) const

Returns the linear velocity y.

在文件 Body3D.cpp 第 321 行定义.

引用了 isValid().

被这些函数引用 eve::climbing::ClimbingRuntime::advance().

◆ getLinearVelocityZ()

float eve::physics::Body3D::getLinearVelocityZ ( ) const

Returns the linear velocity z.

在文件 Body3D.cpp 第 326 行定义.

引用了 isValid().

被这些函数引用 eve::climbing::ClimbingRuntime::advance().

◆ 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

World-space velocity at a point expressed in body-local coordinates.

在文件 Body3D.cpp 第 407 行定义.

引用了 isValid(), value, x, y , 以及 z.

◆ 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

Body mass in kg.

在文件 Body3D.cpp 第 331 行定义.

引用了 isValid().

◆ getRotW()

float eve::physics::Body3D::getRotW ( ) const

Returns the rot w.

在文件 Body3D.cpp 第 306 行定义.

引用了 isValid().

◆ getRotX()

float eve::physics::Body3D::getRotX ( ) const

Returns the rot x.

在文件 Body3D.cpp 第 291 行定义.

引用了 isValid().

◆ getRotY()

float eve::physics::Body3D::getRotY ( ) const

Returns the rot y.

在文件 Body3D.cpp 第 296 行定义.

引用了 isValid().

◆ getRotZ()

float eve::physics::Body3D::getRotZ ( ) const

Returns the rot z.

在文件 Body3D.cpp 第 301 行定义.

引用了 isValid().

◆ getSleepThreshold()

float eve::physics::Body3D::getSleepThreshold ( ) const

Current sleep velocity threshold.

在文件 Body3D.cpp 第 564 行定义.

引用了 isValid().

◆ getType()

std::string eve::physics::Body3D::getType ( ) const

Returns the type.

在文件 Body3D.cpp 第 671 行定义.

引用了 isValid().

◆ getWorld() [1/2]

World3D * eve::physics::Body3D::getWorld ( )
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.

在文件 Body3D.h 第 338 行定义.

被这些函数引用 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]

const World3D * eve::physics::Body3D::getWorld ( ) const
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.

在文件 Body3D.h 第 347 行定义.

◆ 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

World-space velocity at the supplied world point.

在文件 Body3D.cpp 第 421 行定义.

引用了 isValid(), value, x, y , 以及 z.

◆ getX()

float eve::physics::Body3D::getX ( ) const

Returns the x.

在文件 Body3D.cpp 第 259 行定义.

引用了 isValid().

◆ getY()

float eve::physics::Body3D::getY ( ) const

Returns the y.

在文件 Body3D.cpp 第 264 行定义.

引用了 isValid().

◆ getZ()

float eve::physics::Body3D::getZ ( ) const

Returns the z.

在文件 Body3D.cpp 第 269 行定义.

引用了 isValid().

◆ 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

True when active.

在文件 Body3D.cpp 第 699 行定义.

引用了 isValid().

◆ 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

True when awake.

在文件 Body3D.cpp 第 713 行定义.

引用了 isValid().

◆ isBullet()

bool eve::physics::Body3D::isBullet ( ) const

True when bullet.

在文件 Body3D.cpp 第 706 行定义.

引用了 isValid().

◆ isFixedRotation()

bool eve::physics::Body3D::isFixedRotation ( ) const

True when fixed rotation.

在文件 Body3D.cpp 第 685 行定义.

引用了 isValid().

◆ 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

Whether automatic sleeping is enabled.

在文件 Body3D.cpp 第 554 行定义.

引用了 isValid().

◆ 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

Converts a body-local point to world coordinates; returns {x,y,z}.

在文件 Body3D.cpp 第 356 行定义.

引用了 isValid(), value, x, y , 以及 z.

◆ 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.

被这些函数引用 eve::climbing::ClimbingRuntime::advance().

◆ localToWorldVector()

std::vector< float > eve::physics::Body3D::localToWorldVector ( float  x,
float  y,
float  z 
) const

Rotates a body-local direction/vector into world space; returns {x,y,z}.

在文件 Body3D.cpp 第 386 行定义.

引用了 isValid(), value, x, y , 以及 z.

◆ 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.

参数
verticesAt least four finite, non-coplanar points (x0,y0,z0,...).
maxVerticesHull simplification budget in [4, 254].
densityDensity in kg/m^3.
frictionSurface friction.
restitutionSurface restitution.
异常
eve::Exceptionfor 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.

参数
countXNumber of samples along local X, at least two.
countZNumber of samples along local Z, at least two.
cellSizeXPositive spacing in meters along X.
cellSizeZPositive spacing in meters along Z.
heightscountX*countZ row-major world-meter heights.
globalMinShared quantization minimum; heights must lie in range.
globalMaxShared quantization maximum.
clockwiseWindingInverts 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.

参数
verticesFinite local XYZ values.
indicesTriangle indices, three per counter-clockwise face.
weldVerticesWhether nearby source vertices are welded.
weldToleranceNon-negative weld distance in meters.
identifyEdgesWhether shared edges are classified for smooth collision.
useMedianSplitFaster BVH construction for regular grid-like meshes.
异常
eve::Exceptionunless 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=()

Body3D & eve::physics::Body3D::operator= ( const Body3D &  )
delete

◆ raw()

◆ resetMassProperties()

void eve::physics::Body3D::resetMassProperties ( )

Restores automatic mass, center, and inertia calculation from attached shapes.

在文件 Body3D.cpp 第 627 行定义.

引用了 isValid().

◆ runtimeHandle()

PhysicsBodyHandle eve::physics::Body3D::runtimeHandle ( ) const
inlinenoexcept

Returns the process-local solver handle used by PhysicsLink.

返回
Generation-qualified handle; it becomes stale on destruction.

在文件 Body3D.h 第 357 行定义.

◆ setActive()

void eve::physics::Body3D::setActive ( bool  active)

Disables/enables the body and its shapes.

在文件 Body3D.cpp 第 691 行定义.

引用了 active , 以及 isValid().

◆ setAngularDamping()

void eve::physics::Body3D::setAngularDamping ( float  damping)

Angular damping coefficient, finite and non-negative.

在文件 Body3D.cpp 第 529 行定义.

引用了 isValid().

◆ setAngularVelocity()

void eve::physics::Body3D::setAngularVelocity ( float  wx,
float  wy,
float  wz 
)

Angular velocity in rad/s.

在文件 Body3D.cpp 第 336 行定义.

引用了 isValid(), wx, wy , 以及 wz.

◆ setAwake()

void eve::physics::Body3D::setAwake ( bool  awake)

Wakes / sleeps the body manually.

在文件 Body3D.cpp 第 708 行定义.

引用了 awake , 以及 isValid().

◆ setBullet()

void eve::physics::Body3D::setBullet ( bool  bullet)

CCD bullet mode.

在文件 Body3D.cpp 第 701 行定义.

引用了 bullet , 以及 isValid().

◆ setFixedRotation()

void eve::physics::Body3D::setFixedRotation ( bool  fixed)

Lock all angular axes (Box3D motion locks).

在文件 Body3D.cpp 第 676 行定义.

引用了 isValid().

◆ setGravityScale()

void eve::physics::Body3D::setGravityScale ( float  scale)

Multiplier applied to world gravity; may be negative.

在文件 Body3D.cpp 第 539 行定义.

引用了 isValid() , 以及 scale.

◆ setLinearDamping()

void eve::physics::Body3D::setLinearDamping ( float  damping)

Linear damping coefficient, finite and non-negative.

在文件 Body3D.cpp 第 519 行定义.

引用了 isValid().

◆ setLinearVelocity()

void eve::physics::Body3D::setLinearVelocity ( float  vx,
float  vy,
float  vz 
)

Linear velocity in m/s.

在文件 Body3D.cpp 第 311 行定义.

引用了 isValid(), vx, vy , 以及 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.

参数
massPositive mass in kilograms.
centerXLocal center of mass X coordinate.
centerYLocal center of mass Y coordinate.
centerZLocal center of mass Z coordinate.
inertiaXXInertia tensor XX component about the center of mass.
inertiaYYInertia tensor YY component about the center of mass.
inertiaZZInertia tensor ZZ component about the center of mass.
inertiaXYSymmetric inertia tensor XY component.
inertiaXZSymmetric inertia tensor XZ component.
inertiaYZSymmetric inertia tensor YZ component.
异常
eve::Exceptionunless the body is dynamic and the tensor is positive definite.

在文件 Body3D.cpp 第 588 行定义.

引用了 isValid() , 以及 operation.

◆ 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 
)

Position in meters.

在文件 Body3D.cpp 第 254 行定义.

引用了 isValid(), x, y , 以及 z.

◆ setRotation()

void eve::physics::Body3D::setRotation ( float  qx,
float  qy,
float  qz,
float  qw 
)

Orientation as quaternion (x, y, z, w).

在文件 Body3D.cpp 第 274 行定义.

引用了 isValid(), q, qw, qx, qy , 以及 qz.

◆ setSleepEnabled()

void eve::physics::Body3D::setSleepEnabled ( bool  enabled)

Enables or disables automatic sleeping for this body.

在文件 Body3D.cpp 第 549 行定义.

引用了 enabled , 以及 isValid().

◆ setSleepThreshold()

void eve::physics::Body3D::setSleepThreshold ( float  threshold)

Sleep velocity threshold, finite and non-negative.

在文件 Body3D.cpp 第 558 行定义.

引用了 isValid().

◆ setTargetTransform()

void eve::physics::Body3D::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.

在文件 Body3D.cpp 第 504 行定义.

引用了 isValid(), qw, qx, qy, qz, rotation, x, y , 以及 z.

◆ 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

Converts a world point to body-local coordinates; returns {x,y,z}.

在文件 Body3D.cpp 第 372 行定义.

引用了 isValid(), value, x, y , 以及 z.

◆ 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

Rotates a world direction/vector into body-local space; returns {x,y,z}.

在文件 Body3D.cpp 第 400 行定义.

引用了 isValid(), value, x, y , 以及 z.

友元及相关函数文档

◆ Shape3D

friend class Shape3D
friend

◆ World3D

friend class World3D
friend

在文件 Body3D.h 第 364 行定义.

◆ WorldSnapshotAccess

friend struct WorldSnapshotAccess
friend

在文件 Body3D.h 第 363 行定义.


该类的文档由以下文件生成: