Misc fixes

This commit is contained in:
DBotThePony 2022-02-20 14:38:42 +07:00
parent 6b32d0f0c4
commit c82c89dfec
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 8 additions and 9 deletions

View File

@ -1,3 +1,6 @@
@file:Suppress("unused")
package ru.dbotthepony.kbox2d.dynamics package ru.dbotthepony.kbox2d.dynamics
import ru.dbotthepony.kbox2d.api.* import ru.dbotthepony.kbox2d.api.*
@ -273,7 +276,7 @@ class B2Body(def: BodyDef, world: B2World) {
val broadPhase = world.contactManager.broadPhase val broadPhase = world.contactManager.broadPhase
for (fixture in fixtureIterator) { for (fixture in fixtureIterator) {
(fixture as B2Fixture).createProxies(broadPhase, transform) fixture.createProxies(broadPhase, transform)
} }
world.notifyNewContacts() world.notifyNewContacts()
@ -284,7 +287,7 @@ class B2Body(def: BodyDef, world: B2World) {
val broadPhase = world.contactManager.broadPhase val broadPhase = world.contactManager.broadPhase
for (fixture in fixtureIterator) { for (fixture in fixtureIterator) {
(fixture as B2Fixture).destroyProxies(broadPhase) fixture.destroyProxies(broadPhase)
} }
// Destroy the attached contacts. // Destroy the attached contacts.
@ -478,8 +481,6 @@ class B2Body(def: BodyDef, world: B2World) {
} }
} }
fixture as B2Fixture
if (isEnabled) { if (isEnabled) {
fixture.destroyProxies(world.contactManager.broadPhase) fixture.destroyProxies(world.contactManager.broadPhase)
} }
@ -868,11 +869,11 @@ class B2Body(def: BodyDef, world: B2World) {
transform1.position = sweep.c0 - transform1.rotation.times(sweep.localCenter) transform1.position = sweep.c0 - transform1.rotation.times(sweep.localCenter)
for (fixture in fixtureIterator) { for (fixture in fixtureIterator) {
(fixture as B2Fixture).synchronize(broadPhase, transform1, transform) fixture.synchronize(broadPhase, transform1, transform)
} }
} else { } else {
for (fixture in fixtureIterator) { for (fixture in fixtureIterator) {
(fixture as B2Fixture).synchronize(broadPhase, transform, transform) fixture.synchronize(broadPhase, transform, transform)
} }
} }
} }

View File

@ -464,7 +464,7 @@ abstract class Chunk<WorldType : World<WorldType, This>, This : Chunk<WorldType,
} }
override fun randomLongFor(x: Int, y: Int): Long { override fun randomLongFor(x: Int, y: Int): Long {
return super.randomLongFor(x, y) xor (world?.seed ?: 0L) return super.randomLongFor(x, y) xor world.seed
} }
} }

View File

@ -442,8 +442,6 @@ abstract class World<This : World<This, ChunkType>, ChunkType : Chunk<This, Chun
} }
} }
} }
potentialAABB = worldaabb + deltaMovement
} }
} }