mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
collision is bugged
This commit is contained in:
parent
437f5efdde
commit
c817886672
4 changed files with 6 additions and 3 deletions
BIN
marblegame.hl
BIN
marblegame.hl
Binary file not shown.
|
|
@ -80,7 +80,7 @@ class Settings {
|
||||||
invertYAxis: false
|
invertYAxis: false
|
||||||
};
|
};
|
||||||
|
|
||||||
public static var progression = [24, 24, 52];
|
public static var progression = [0, 0, 0];
|
||||||
public static var highscoreName = "";
|
public static var highscoreName = "";
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rotateImage(bitmap:BitmapData, angle:Float) {
|
public static function rotateImage(bitmap:BitmapData, angle:Float) {
|
||||||
var curpixels = bitmap.getPixels().clone();
|
|
||||||
bitmap.lock();
|
bitmap.lock();
|
||||||
|
var curpixels = bitmap.getPixels().clone();
|
||||||
if (angle == Math.PI / 2)
|
if (angle == Math.PI / 2)
|
||||||
for (x in 0...curpixels.width) {
|
for (x in 0...curpixels.width) {
|
||||||
for (y in 0...curpixels.height) {
|
for (y in 0...curpixels.height) {
|
||||||
|
|
@ -62,8 +62,8 @@ class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function flipImage(bitmap:BitmapData, hflip:Bool, vflip:Bool) {
|
public static function flipImage(bitmap:BitmapData, hflip:Bool, vflip:Bool) {
|
||||||
var curpixels = bitmap.getPixels().clone();
|
|
||||||
bitmap.lock();
|
bitmap.lock();
|
||||||
|
var curpixels = bitmap.getPixels().clone();
|
||||||
if (hflip)
|
if (hflip)
|
||||||
for (x in 0...curpixels.width) {
|
for (x in 0...curpixels.width) {
|
||||||
for (y in 0...curpixels.height) {
|
for (y in 0...curpixels.height) {
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,11 @@ class CollisionEntity implements IOctreeObject {
|
||||||
var invMatrix = transform.clone();
|
var invMatrix = transform.clone();
|
||||||
invMatrix.invert();
|
invMatrix.invert();
|
||||||
var sphereBounds = new Bounds();
|
var sphereBounds = new Bounds();
|
||||||
|
var localPos = position.clone();
|
||||||
|
localPos.transform(invMatrix);
|
||||||
sphereBounds.addSpherePos(position.x, position.y, position.z, radius * 1.1);
|
sphereBounds.addSpherePos(position.x, position.y, position.z, radius * 1.1);
|
||||||
sphereBounds.transform(invMatrix);
|
sphereBounds.transform(invMatrix);
|
||||||
|
sphereBounds.addSpherePos(localPos.x, localPos.y, localPos.z, radius * 1.1);
|
||||||
var surfaces = octree.boundingSearch(sphereBounds);
|
var surfaces = octree.boundingSearch(sphereBounds);
|
||||||
|
|
||||||
var tform = transform.clone();
|
var tform = transform.clone();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue