Add PhysWorld2D::UseSpatialHash
This commit is contained in:
parent
17849226e4
commit
bb7c97ed9a
|
|
@ -64,6 +64,7 @@ Nazara Engine:
|
|||
- ⚠️ LuaInstance no longer load all lua libraries on construction, this is done in the new LoadLibraries method which allows you to excludes some libraries
|
||||
- Clock::Restart now returns the elapsed microseconds since construction or last Restart call
|
||||
- Add PhysWorld2D::[Get|Set]IterationCount to control how many iterations chipmunk will perform per step.
|
||||
- Add PhysWorld2D::UseSpatialHash to use spatial hashing instead of bounding box trees, which may speedup simulation in some cases.
|
||||
|
||||
Nazara Development Kit:
|
||||
- Added ImageWidget (#139)
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ namespace Nz
|
|||
|
||||
void Step(float timestep);
|
||||
|
||||
void UseSpatialHash(float cellSize, std::size_t entityCount);
|
||||
|
||||
PhysWorld2D& operator=(const PhysWorld2D&) = delete;
|
||||
PhysWorld2D& operator=(PhysWorld2D&&) = delete; ///TODO
|
||||
|
||||
|
|
|
|||
|
|
@ -322,6 +322,11 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
void PhysWorld2D::UseSpatialHash(float cellSize, std::size_t entityCount)
|
||||
{
|
||||
cpSpaceUseSpatialHash(m_handle, cpFloat(cellSize), int(entityCount));
|
||||
}
|
||||
|
||||
void PhysWorld2D::InitCallbacks(cpCollisionHandler* handler, const Callback& callbacks)
|
||||
{
|
||||
auto it = m_callbacks.emplace(handler, std::make_unique<Callback>(callbacks)).first;
|
||||
|
|
|
|||
Loading…
Reference in New Issue