mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix item collection i guess??
This commit is contained in:
parent
1c7ad635f8
commit
affbceda51
2 changed files with 24 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ import h3d.col.Bounds;
|
||||||
class BoxCollisionEntity extends CollisionEntity {
|
class BoxCollisionEntity extends CollisionEntity {
|
||||||
var bounds:Bounds;
|
var bounds:Bounds;
|
||||||
|
|
||||||
var _dbgEntity:h3d.scene.Mesh;
|
var _dbgEntity:h3d.scene.Object;
|
||||||
|
|
||||||
public function new(bounds:Bounds, go:GameObject) {
|
public function new(bounds:Bounds, go:GameObject) {
|
||||||
super(go);
|
super(go);
|
||||||
|
|
@ -25,22 +25,22 @@ class BoxCollisionEntity extends CollisionEntity {
|
||||||
this.boundingBox = bounds.clone();
|
this.boundingBox = bounds.clone();
|
||||||
this.boundingBox.transform(this.transform);
|
this.boundingBox.transform(this.transform);
|
||||||
// if (_dbgEntity == null) {
|
// if (_dbgEntity == null) {
|
||||||
// var cube = new h3d.prim.Cube(this.boundingBox.xSize, this.boundingBox.ySize, this.boundingBox.zSize, true);
|
// _dbgEntity = this.boundingBox.makeDebugObj();
|
||||||
// cube.addNormals();
|
// _dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||||
// cube.addUVs();
|
|
||||||
// _dbgEntity = new h3d.scene.Mesh(cube);
|
|
||||||
// _dbgEntity.material.mainPass.wireframe = true;
|
|
||||||
// _dbgEntity.setTransform(transform);
|
|
||||||
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||||
// } else {
|
// } else {
|
||||||
// _dbgEntity.setTransform(transform);
|
// _dbgEntity = this.boundingBox.makeDebugObj();
|
||||||
|
// _dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||||
|
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function setTransform(transform:Matrix) {
|
public override function setTransform(transform:Matrix) {
|
||||||
super.setTransform(transform);
|
super.setTransform(transform);
|
||||||
// if (_dbgEntity != null) {
|
// if (_dbgEntity != null) {
|
||||||
// _dbgEntity.setTransform(transform);
|
// _dbgEntity = this.boundingBox.makeDebugObj();
|
||||||
|
// _dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||||
|
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ class SphereCollisionEntity extends CollisionEntity {
|
||||||
public var marble:Marble;
|
public var marble:Marble;
|
||||||
|
|
||||||
var _dbgEntity:h3d.scene.Mesh;
|
var _dbgEntity:h3d.scene.Mesh;
|
||||||
|
var _dbgEntity2:h3d.scene.Mesh;
|
||||||
|
|
||||||
public function new(marble:Marble) {
|
public function new(marble:Marble) {
|
||||||
super(cast marble);
|
super(cast marble);
|
||||||
|
|
@ -27,6 +28,7 @@ class SphereCollisionEntity extends CollisionEntity {
|
||||||
var boundingBox = new Bounds();
|
var boundingBox = new Bounds();
|
||||||
var pos = transform.getPosition();
|
var pos = transform.getPosition();
|
||||||
boundingBox.addSpherePos(pos.x, pos.y, pos.z, radius);
|
boundingBox.addSpherePos(pos.x, pos.y, pos.z, radius);
|
||||||
|
boundingBox.transform3x3(transform);
|
||||||
this.boundingBox = boundingBox;
|
this.boundingBox = boundingBox;
|
||||||
|
|
||||||
// if (_dbgEntity == null) {
|
// if (_dbgEntity == null) {
|
||||||
|
|
@ -37,8 +39,21 @@ class SphereCollisionEntity extends CollisionEntity {
|
||||||
// _dbgEntity.material.mainPass.wireframe = true;
|
// _dbgEntity.material.mainPass.wireframe = true;
|
||||||
// _dbgEntity.setTransform(transform);
|
// _dbgEntity.setTransform(transform);
|
||||||
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
// MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||||
|
|
||||||
|
// var cube2 = new h3d.prim.Cube(this.boundingBox.xSize, this.boundingBox.ySize, this.boundingBox.zSize, true);
|
||||||
|
// cube2.addNormals();
|
||||||
|
// cube2.addUVs();
|
||||||
|
// _dbgEntity2 = new h3d.scene.Mesh(cube2);
|
||||||
|
// _dbgEntity2.material.mainPass.wireframe = true;
|
||||||
|
// _dbgEntity2.setTransform(transform);
|
||||||
|
// MarbleGame.instance.scene.addChild(_dbgEntity2);
|
||||||
// } else {
|
// } else {
|
||||||
// _dbgEntity.setTransform(transform);
|
// _dbgEntity.setTransform(transform);
|
||||||
|
// var cube2 = new h3d.prim.Cube(this.boundingBox.xSize, this.boundingBox.ySize, this.boundingBox.zSize, true);
|
||||||
|
// cube2.addNormals();
|
||||||
|
// cube2.addUVs();
|
||||||
|
// _dbgEntity2.primitive = cube2;
|
||||||
|
// _dbgEntity2.setPosition(pos.x, pos.y, pos.z);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue