Class CachingCollisionTester
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Originally intended to be a special version of CollisionTester for BehaviorControlledPhysics, which does not re-do the WalkBlocks() call and re-generate the CollisionBoxList more than once in the same entity tick
Currently in 1.20 the caching is not very useful when we loop through all entities sequentially - but empirical testing shows it is actually faster not to cache Open in GitHub
public class CachingCollisionTester : CollisionTester
- Inheritance
-
CachingCollisionTester
- Inherited Members
- Extension Methods
Methods
AssignToEntity(PhysicsBehaviorBase, int)
public void AssignToEntity(PhysicsBehaviorBase entityPhysics, int dimension)
Parameters
entityPhysicsPhysicsBehaviorBasedimensionint
GenerateCollisionBoxList(IBlockAccessor, double, double, double, float, float, int)
protected override void GenerateCollisionBoxList(IBlockAccessor blockAccessor, double motionX, double motionY, double motionZ, float stepHeight, float yExtra, int dimension)
Parameters
blockAccessorIBlockAccessormotionXdoublemotionYdoublemotionZdoublestepHeightfloatyExtrafloatdimensionint
NewTick(EntityPos)
public void NewTick(EntityPos entityPos)
Parameters
entityPosEntityPos
PushOutFromBlocks(IBlockAccessor, Entity, Vec3d, float)
public void PushOutFromBlocks(IBlockAccessor blockAccessor, Entity entity, Vec3d tmpVec, float clippingLimit)
Parameters
blockAccessorIBlockAccessorentityEntitytmpVecVec3dclippingLimitfloat