MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / IntersectsBlock

Function IntersectsBlock

src/Particle.c:97–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static cc_bool IntersectsBlock(struct Particle* p, CanPassThroughFunc canPassThrough) {
98 BlockID cur = GetBlock((int)p->nextPos.x, (int)p->nextPos.y, (int)p->nextPos.z);
99 float minY = Math_Floor(p->nextPos.y) + Blocks.MinBB[cur].y;
100 float maxY = Math_Floor(p->nextPos.y) + Blocks.MaxBB[cur].y;
101
102 return !canPassThrough(cur) && p->nextPos.y >= minY && p->nextPos.y < maxY && CollidesHor(&p->nextPos, cur);
103}
104
105static cc_bool PhysicsTick(struct Particle* p, float gravity, CanPassThroughFunc canPassThrough, float delta) {
106 Vec3 velocity;

Callers 2

PhysicsTickFunction · 0.85
Particles_CustomEffectFunction · 0.85

Calls 3

GetBlockFunction · 0.85
Math_FloorFunction · 0.85
CollidesHorFunction · 0.85

Tested by

no test coverage detected