collision is bugged

This commit is contained in:
RandomityGuy 2021-07-12 21:57:53 +05:30
parent 437f5efdde
commit c817886672
4 changed files with 6 additions and 3 deletions

Binary file not shown.

View file

@ -80,7 +80,7 @@ class Settings {
invertYAxis: false
};
public static var progression = [24, 24, 52];
public static var progression = [0, 0, 0];
public static var highscoreName = "";
public static function applySettings() {

View file

@ -38,8 +38,8 @@ class Util {
}
public static function rotateImage(bitmap:BitmapData, angle:Float) {
var curpixels = bitmap.getPixels().clone();
bitmap.lock();
var curpixels = bitmap.getPixels().clone();
if (angle == Math.PI / 2)
for (x in 0...curpixels.width) {
for (y in 0...curpixels.height) {
@ -62,8 +62,8 @@ class Util {
}
public static function flipImage(bitmap:BitmapData, hflip:Bool, vflip:Bool) {
var curpixels = bitmap.getPixels().clone();
bitmap.lock();
var curpixels = bitmap.getPixels().clone();
if (hflip)
for (x in 0...curpixels.width) {
for (y in 0...curpixels.height) {

View file

@ -92,8 +92,11 @@ class CollisionEntity implements IOctreeObject {
var invMatrix = transform.clone();
invMatrix.invert();
var sphereBounds = new Bounds();
var localPos = position.clone();
localPos.transform(invMatrix);
sphereBounds.addSpherePos(position.x, position.y, position.z, radius * 1.1);
sphereBounds.transform(invMatrix);
sphereBounds.addSpherePos(localPos.x, localPos.y, localPos.z, radius * 1.1);
var surfaces = octree.boundingSearch(sphereBounds);
var tform = transform.clone();