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

Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixels + Physics.setMeter. 更多...

#include <World3D.h>

Public 成员函数

 World3D (float gravityX, float gravityY, float gravityZ, bool sleep)
 
 ~World3D ()
 
 World3D (const World3D &)=delete
 
World3Doperator= (const World3D &)=delete
 
void update (float dt)
 Steps the simulation by dt seconds (default substep count).
 
void updateFull (float dt, int subStepCount)
 Steps with an explicit substep count.
 
void setGravity (float gx, float gy, float gz)
 Gravity in m/s².
 
float getGravityX () const
 
float getGravityY () const
 
float getGravityZ () const
 
Body3DnewBody (const std::string &bodyType, float x, float y, float z)
 bodyType: "static" | "kinematic" | "dynamic". Position in meters.
 
void destroyBody (Body3D *body)
 Destroys a body (null is ignored).
 
void destroy ()
 Destroys the world and invalidates all wrappers.
 
int rayCast (float x1, float y1, float z1, float x2, float y2, float z2)
 Closest raycast from (x1,y1,z1) to (x2,y2,z2) in meters. Returns hit body id, or -1. Read hit details via getRayHit*.
 
bool hasRayHit () const
 
int getRayHitBodyId () const
 
float getRayHitX () const
 
float getRayHitY () const
 
float getRayHitZ () const
 
float getRayHitNormalX () const
 
float getRayHitNormalY () const
 
float getRayHitNormalZ () const
 
float getRayHitFraction () const
 
int queryAABB (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 Query shapes overlapping an AABB in meters (min/max corners). Returns match count; read ids with getQueryBodyId(i).
 
int getQueryCount () const
 Number of bodies hit by the last queryAABB().
 
int getQueryBodyId (int index) const
 Body id of the i-th query hit.
 
bool isValid () const
 True while the underlying Box3D world is alive.
 
b3WorldId raw () const
 Raw Box3D world id.
 
void forgetBody (Body3D *body)
 Internal: wrapper teardown bookkeeping.
 
void forgetShape (Shape3D *shape)
 
int nextBodyId ()
 Internal: next stable body id.
 
void emitContactEvents ()
 Internal: collects Box3D contact events into the event buffers.
 

友元

class Body3D
 
class Shape3D
 

详细描述

Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixels + Physics.setMeter.

在文件 World3D.h18 行定义.

构造及析构函数说明

◆ World3D() [1/2]

eve::physics::World3D::World3D ( float  gravityX,
float  gravityY,
float  gravityZ,
bool  sleep 
)

在文件 World3D.cpp32 行定义.

◆ ~World3D()

eve::physics::World3D::~World3D ( )

在文件 World3D.cpp39 行定义.

引用了 destroy().

◆ World3D() [2/2]

eve::physics::World3D::World3D ( const World3D )
delete

成员函数说明

◆ destroy()

void eve::physics::World3D::destroy ( )

Destroys the world and invalidates all wrappers.

在文件 World3D.cpp43 行定义.

引用了 b , 以及 s.

被这些函数引用 ~World3D().

◆ destroyBody()

void eve::physics::World3D::destroyBody ( Body3D body)

Destroys a body (null is ignored).

在文件 World3D.cpp113 行定义.

引用了 body.

◆ emitContactEvents()

void eve::physics::World3D::emitContactEvents ( )

Internal: collects Box3D contact events into the event buffers.

在文件 World3D.cpp121 行定义.

引用了 a, b, isValid() , 以及 eve::event::Variant::makeInt().

被这些函数引用 updateFull().

◆ forgetBody()

void eve::physics::World3D::forgetBody ( Body3D body)

Internal: wrapper teardown bookkeeping.

在文件 World3D.cpp118 行定义.

引用了 body.

被这些函数引用 eve::physics::Body3D::destroy() , 以及 eve::physics::Body3D::~Body3D().

◆ forgetShape()

void eve::physics::World3D::forgetShape ( Shape3D shape)

◆ getGravityX()

float eve::physics::World3D::getGravityX ( ) const

在文件 World3D.cpp81 行定义.

引用了 isValid().

◆ getGravityY()

float eve::physics::World3D::getGravityY ( ) const

在文件 World3D.cpp86 行定义.

引用了 isValid().

◆ getGravityZ()

float eve::physics::World3D::getGravityZ ( ) const

在文件 World3D.cpp91 行定义.

引用了 isValid().

◆ getQueryBodyId()

int eve::physics::World3D::getQueryBodyId ( int  index) const

Body id of the i-th query hit.

在文件 World3D.cpp204 行定义.

◆ getQueryCount()

int eve::physics::World3D::getQueryCount ( ) const
inline

Number of bodies hit by the last queryAABB().

在文件 World3D.h66 行定义.

◆ getRayHitBodyId()

int eve::physics::World3D::getRayHitBodyId ( ) const
inline

在文件 World3D.h51 行定义.

◆ getRayHitFraction()

float eve::physics::World3D::getRayHitFraction ( ) const
inline

在文件 World3D.h58 行定义.

◆ getRayHitNormalX()

float eve::physics::World3D::getRayHitNormalX ( ) const
inline

在文件 World3D.h55 行定义.

◆ getRayHitNormalY()

float eve::physics::World3D::getRayHitNormalY ( ) const
inline

在文件 World3D.h56 行定义.

◆ getRayHitNormalZ()

float eve::physics::World3D::getRayHitNormalZ ( ) const
inline

在文件 World3D.h57 行定义.

◆ getRayHitX()

float eve::physics::World3D::getRayHitX ( ) const
inline

在文件 World3D.h52 行定义.

◆ getRayHitY()

float eve::physics::World3D::getRayHitY ( ) const
inline

在文件 World3D.h53 行定义.

◆ getRayHitZ()

float eve::physics::World3D::getRayHitZ ( ) const
inline

在文件 World3D.h54 行定义.

◆ hasRayHit()

bool eve::physics::World3D::hasRayHit ( ) const
inline

在文件 World3D.h50 行定义.

◆ isValid()

bool eve::physics::World3D::isValid ( ) const

True while the underlying Box3D world is alive.

在文件 World3D.cpp41 行定义.

被这些函数引用 eve::physics::Body3D::destroy(), emitContactEvents(), getGravityX(), getGravityY(), getGravityZ(), newBody(), queryAABB(), rayCast(), setGravity(), updateFull() , 以及 eve::physics::Body3D::~Body3D().

◆ newBody()

Body3D * eve::physics::World3D::newBody ( const std::string &  bodyType,
float  x,
float  y,
float  z 
)

bodyType: "static" | "kinematic" | "dynamic". Position in meters.

在文件 World3D.cpp98 行定义.

引用了 body, Body3D, isValid(), nextBodyId(), raw(), x, y , 以及 z.

◆ nextBodyId()

int eve::physics::World3D::nextBodyId ( )

Internal: next stable body id.

在文件 World3D.cpp96 行定义.

被这些函数引用 newBody().

◆ operator=()

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

◆ queryAABB()

int eve::physics::World3D::queryAABB ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

Query shapes overlapping an AABB in meters (min/max corners). Returns match count; read ids with getQueryBodyId(i).

在文件 World3D.cpp177 行定义.

引用了 b, filter , 以及 isValid().

◆ raw()

b3WorldId eve::physics::World3D::raw ( ) const
inline

Raw Box3D world id.

在文件 World3D.h73 行定义.

被这些函数引用 newBody().

◆ rayCast()

int eve::physics::World3D::rayCast ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)

Closest raycast from (x1,y1,z1) to (x2,y2,z2) in meters. Returns hit body id, or -1. Read hit details via getRayHit*.

在文件 World3D.cpp146 行定义.

引用了 body, filter , 以及 isValid().

◆ setGravity()

void eve::physics::World3D::setGravity ( float  gx,
float  gy,
float  gz 
)

Gravity in m/s².

在文件 World3D.cpp76 行定义.

引用了 isValid().

◆ update()

void eve::physics::World3D::update ( float  dt)

Steps the simulation by dt seconds (default substep count).

在文件 World3D.cpp65 行定义.

引用了 updateFull().

◆ updateFull()

void eve::physics::World3D::updateFull ( float  dt,
int  subStepCount 
)

Steps with an explicit substep count.

在文件 World3D.cpp67 行定义.

引用了 emitContactEvents() , 以及 isValid().

被这些函数引用 update().

友元及相关函数文档

◆ Body3D

friend class Body3D
friend

在文件 World3D.h86 行定义.

被这些函数引用 newBody().

◆ Shape3D

friend class Shape3D
friend

在文件 World3D.h87 行定义.


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