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

Physics module — Box2D (2D) + Box3D (3D) rigid bodies, plus interactive cloth / SPH fluid. Script: physics <- eve.Physics(); world <- physics.newWorld(0, 900); world3 <- physics.newWorld3D(0, -9.8, 0); 更多...

#include <Physics.h>

类 eve::physics::Physics 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Physics)
 
 Physics ()
 
 ~Physics () override=default
 
void setMeter (float pixelsPerMeter)
 Pixels per meter for 2D Box2D worlds (default 30, same as LÖVE).
 
float getMeter () const
 
WorldnewWorld (float gravityX, float gravityY, bool sleep=true)
 Create a 2D Box2D physics world.
 
World3DnewWorld3D (float gravityX, float gravityY, float gravityZ, bool sleep=true)
 Create a 3D Box3D physics world. Coordinates are meters (Box3D native); +Y is up by convention.
 
ClothnewCloth (int cols, int rows, float spacing, float originX, float originY)
 Create a Verlet cloth grid (top row pinned).
 
FluidnewFluid (int capacity=512)
 Create an SPH fluid container with particle capacity.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

详细描述

Physics module — Box2D (2D) + Box3D (3D) rigid bodies, plus interactive cloth / SPH fluid. Script: physics <- eve.Physics(); world <- physics.newWorld(0, 900); world3 <- physics.newWorld3D(0, -9.8, 0);

在文件 Physics.h17 行定义.

构造及析构函数说明

◆ Physics()

eve::physics::Physics::Physics ( )

在文件 Physics.cpp18 行定义.

引用了 eve::physics::registerPhysicsCapabilities().

◆ ~Physics()

eve::physics::Physics::~Physics ( )
overridedefault

成员函数说明

◆ getMeter()

float eve::physics::Physics::getMeter ( ) const

在文件 Physics.cpp28 行定义.

◆ Module_REG()

eve::physics::Physics::Module_REG ( Physics  )

◆ newCloth()

Cloth * eve::physics::Physics::newCloth ( int  cols,
int  rows,
float  spacing,
float  originX,
float  originY 
)

Create a Verlet cloth grid (top row pinned).

参数
colscolumns (>= 2)
rowsrows (>= 2)
spacingparticle spacing in pixels
originXtop-left X in pixels
originYtop-left Y in pixels

在文件 Physics.cpp38 行定义.

引用了 spacing.

◆ newFluid()

Fluid * eve::physics::Physics::newFluid ( int  capacity = 512)

Create an SPH fluid container with particle capacity.

参数
capacitymax particles (>= 1)

在文件 Physics.cpp42 行定义.

◆ newWorld()

World * eve::physics::Physics::newWorld ( float  gravityX,
float  gravityY,
bool  sleep = true 
)

Create a 2D Box2D physics world.

参数
gravityXgravity X in pixels/s²
gravityYgravity Y in pixels/s²
sleepallow sleeping bodies

在文件 Physics.cpp30 行定义.

◆ newWorld3D()

World3D * eve::physics::Physics::newWorld3D ( float  gravityX,
float  gravityY,
float  gravityZ,
bool  sleep = true 
)

Create a 3D Box3D physics world. Coordinates are meters (Box3D native); +Y is up by convention.

参数
gravityXgravity X in m/s²
gravityYgravity Y in m/s²
gravityZgravity Z in m/s²
sleepallow sleeping bodies

在文件 Physics.cpp34 行定义.

◆ setMeter()

void eve::physics::Physics::setMeter ( float  pixelsPerMeter)

Pixels per meter for 2D Box2D worlds (default 30, same as LÖVE).

在文件 Physics.cpp22 行定义.


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