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

3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create shapes with newBoxShape/newSphereShape/newCapsuleShape. 更多...

#include <Body3D.h>

Public 成员函数

 Body3D (World3D *world, b3BodyId bodyId, int id)
 Internal: wraps a Box3D body (use World3D::newBody).
 
 ~Body3D ()
 
 Body3D (const Body3D &)=delete
 
Body3Doperator= (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
 
float getY () const
 
float getZ () const
 
void setRotation (float qx, float qy, float qz, float qw)
 Orientation as quaternion (x, y, z, w).
 
float getRotX () const
 
float getRotY () const
 
float getRotZ () const
 
float getRotW () const
 
void setLinearVelocity (float vx, float vy, float vz)
 Linear velocity in m/s.
 
float getLinearVelocityX () const
 
float getLinearVelocityY () const
 
float getLinearVelocityZ () const
 
void setAngularVelocity (float wx, float wy, float wz)
 Angular velocity in rad/s.
 
float getAngularVelocityX () const
 
float getAngularVelocityY () const
 
float getAngularVelocityZ () const
 
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 applyLinearImpulse (float ix, float iy, float iz)
 Instantaneous linear impulse.
 
void applyAngularImpulse (float ix, float iy, float iz)
 Instantaneous angular impulse.
 
void setType (const std::string &bodyType)
 "static" | "kinematic" | "dynamic".
 
std::string getType () const
 
void setFixedRotation (bool fixed)
 Lock all angular axes (Box3D motion locks).
 
bool isFixedRotation () const
 
void setActive (bool active)
 Disables/enables the body and its shapes.
 
bool isActive () const
 
void setBullet (bool bullet)
 CCD bullet mode.
 
bool isBullet () const
 
void setAwake (bool awake)
 Wakes / sleeps the body manually.
 
bool isAwake () const
 
Shape3DnewBoxShape (float width, float height, float depth, float density=1.f, float friction=0.2f, float restitution=0.f)
 Box extents are full width/height/depth in meters (same convention as Body.newRectangleFixture). Density kg/m³.
 
Shape3DnewSphereShape (float radius, float density=1.f, float friction=0.2f, float restitution=0.f)
 
Shape3DnewCapsuleShape (float height, float radius, float density=1.f, float friction=0.2f, float restitution=0.f)
 Capsule along local Y; height is distance between hemisphere centers.
 
void destroy ()
 Destroys the body inside its world.
 
World3DgetWorld ()
 Owning world / raw Box3D body id.
 
b3BodyId raw () const
 
bool isValid () const
 True while the underlying Box3D body is still alive.
 
void invalidate ()
 Internal: marks the wrapper invalid after world destruction.
 

友元

class World3D
 
class Shape3D
 

详细描述

3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create shapes with newBoxShape/newSphereShape/newCapsuleShape.

在文件 Body3D.h16 行定义.

构造及析构函数说明

◆ Body3D() [1/2]

eve::physics::Body3D::Body3D ( World3D world,
b3BodyId  bodyId,
int  id 
)

Internal: wraps a Box3D body (use World3D::newBody).

在文件 Body3D.cpp43 行定义.

◆ ~Body3D()

eve::physics::Body3D::~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.cpp205 行定义.

引用了 isValid().

◆ applyForce()

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

Force applied at the center of mass.

在文件 Body3D.cpp190 行定义.

引用了 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.cpp195 行定义.

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

◆ applyLinearImpulse()

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

Instantaneous linear impulse.

在文件 Body3D.cpp200 行定义.

引用了 isValid().

◆ destroy()

void eve::physics::Body3D::destroy ( )

Destroys the body inside its world.

在文件 Body3D.cpp72 行定义.

引用了 eve::physics::World3D::forgetBody(), eve::physics::World3D::forgetShape(), invalidate(), isValid(), eve::physics::World3D::isValid() , 以及 s.

◆ getAngularVelocityX()

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

在文件 Body3D.cpp175 行定义.

引用了 isValid().

◆ getAngularVelocityY()

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

在文件 Body3D.cpp180 行定义.

引用了 isValid().

◆ getAngularVelocityZ()

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

在文件 Body3D.cpp185 行定义.

引用了 isValid().

◆ getId()

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

Stable id used by collision events.

在文件 Body3D.h26 行定义.

◆ getLinearVelocityX()

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

在文件 Body3D.cpp155 行定义.

引用了 isValid().

◆ getLinearVelocityY()

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

在文件 Body3D.cpp160 行定义.

引用了 isValid().

◆ getLinearVelocityZ()

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

在文件 Body3D.cpp165 行定义.

引用了 isValid().

◆ getRotW()

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

在文件 Body3D.cpp145 行定义.

引用了 isValid().

◆ getRotX()

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

在文件 Body3D.cpp130 行定义.

引用了 isValid().

◆ getRotY()

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

在文件 Body3D.cpp135 行定义.

引用了 isValid().

◆ getRotZ()

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

在文件 Body3D.cpp140 行定义.

引用了 isValid().

◆ getType()

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

在文件 Body3D.cpp215 行定义.

引用了 isValid().

◆ getWorld()

World3D * eve::physics::Body3D::getWorld ( )
inline

Owning world / raw Box3D body id.

在文件 Body3D.h98 行定义.

◆ getX()

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

在文件 Body3D.cpp98 行定义.

引用了 isValid().

◆ getY()

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

在文件 Body3D.cpp103 行定义.

引用了 isValid().

◆ getZ()

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

在文件 Body3D.cpp108 行定义.

引用了 isValid().

◆ invalidate()

void eve::physics::Body3D::invalidate ( )

Internal: marks the wrapper invalid after world destruction.

在文件 Body3D.cpp66 行定义.

引用了 isValid().

被这些函数引用 destroy().

◆ isActive()

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

在文件 Body3D.cpp243 行定义.

引用了 isValid().

◆ isAwake()

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

在文件 Body3D.cpp257 行定义.

引用了 isValid().

◆ isBullet()

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

在文件 Body3D.cpp250 行定义.

引用了 isValid().

◆ isFixedRotation()

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

在文件 Body3D.cpp229 行定义.

引用了 isValid().

◆ isValid()

◆ newBoxShape()

Shape3D * eve::physics::Body3D::newBoxShape ( float  width,
float  height,
float  depth,
float  density = 1.f,
float  friction = 0.2f,
float  restitution = 0.f 
)

Box extents are full width/height/depth in meters (same convention as Body.newRectangleFixture). Density kg/m³.

在文件 Body3D.cpp259 行定义.

引用了 eve::physics::Shape3D::Box, depth, height, isValid(), Shape3D , 以及 width.

◆ newCapsuleShape()

Shape3D * eve::physics::Body3D::newCapsuleShape ( float  height,
float  radius,
float  density = 1.f,
float  friction = 0.2f,
float  restitution = 0.f 
)

Capsule along local Y; height is distance between hemisphere centers.

在文件 Body3D.cpp296 行定义.

引用了 eve::physics::Shape3D::Capsule, height, isValid() , 以及 Shape3D.

◆ newSphereShape()

Shape3D * eve::physics::Body3D::newSphereShape ( float  radius,
float  density = 1.f,
float  friction = 0.2f,
float  restitution = 0.f 
)

在文件 Body3D.cpp279 行定义.

引用了 isValid(), Shape3D , 以及 eve::physics::Shape3D::Sphere.

◆ operator=()

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

◆ raw()

b3BodyId eve::physics::Body3D::raw ( ) const
inline

在文件 Body3D.h99 行定义.

被这些函数引用 eve::physics::Shape3D::testPoint().

◆ setActive()

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

Disables/enables the body and its shapes.

在文件 Body3D.cpp235 行定义.

引用了 active , 以及 isValid().

◆ setAngularVelocity()

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

Angular velocity in rad/s.

在文件 Body3D.cpp170 行定义.

引用了 isValid().

◆ setAwake()

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

Wakes / sleeps the body manually.

在文件 Body3D.cpp252 行定义.

引用了 isValid().

◆ setBullet()

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

CCD bullet mode.

在文件 Body3D.cpp245 行定义.

引用了 isValid().

◆ setFixedRotation()

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

Lock all angular axes (Box3D motion locks).

在文件 Body3D.cpp220 行定义.

引用了 isValid().

◆ setLinearVelocity()

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

Linear velocity in m/s.

在文件 Body3D.cpp150 行定义.

引用了 isValid().

◆ setPosition()

void eve::physics::Body3D::setPosition ( float  x,
float  y,
float  z 
)

Position in meters.

在文件 Body3D.cpp93 行定义.

引用了 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.cpp113 行定义.

引用了 isValid().

◆ setType()

void eve::physics::Body3D::setType ( const std::string &  bodyType)

"static" | "kinematic" | "dynamic".

在文件 Body3D.cpp210 行定义.

引用了 isValid().

友元及相关函数文档

◆ Shape3D

friend class Shape3D
friend

在文件 Body3D.h108 行定义.

被这些函数引用 newBoxShape(), newCapsuleShape() , 以及 newSphereShape().

◆ World3D

friend class World3D
friend

在文件 Body3D.h107 行定义.


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