forked from LeenkxTeam/LNXSDK
Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx
This commit is contained in:
parent
c4b48c2d87
commit
62e52a7316
@ -71,6 +71,7 @@ class PhysicsWorld extends Trait {
|
|||||||
public var convexHitPointWorld = new Vec4();
|
public var convexHitPointWorld = new Vec4();
|
||||||
public var convexHitNormalWorld = new Vec4();
|
public var convexHitNormalWorld = new Vec4();
|
||||||
var pairCache: Bool = false;
|
var pairCache: Bool = false;
|
||||||
|
public var drawRaycasts: Bool = false;
|
||||||
|
|
||||||
static var nullvec = true;
|
static var nullvec = true;
|
||||||
static var vec1: bullet.Bt.Vector3 = null;
|
static var vec1: bullet.Bt.Vector3 = null;
|
||||||
@ -101,7 +102,7 @@ class PhysicsWorld extends Trait {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function new(timeScale = 1.0, maxSteps = 10, solverIterations = 10, debugDrawMode: DebugDrawMode = NoDebug) {
|
public function new(timeScale = 1.0, maxSteps = 10, solverIterations = 10, debugDrawMode: DebugDrawMode = NoDebug, drawRaycasts: Bool = false) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
if (nullvec) {
|
if (nullvec) {
|
||||||
@ -120,6 +121,7 @@ class PhysicsWorld extends Trait {
|
|||||||
this.timeScale = timeScale;
|
this.timeScale = timeScale;
|
||||||
this.maxSteps = maxSteps;
|
this.maxSteps = maxSteps;
|
||||||
this.solverIterations = solverIterations;
|
this.solverIterations = solverIterations;
|
||||||
|
this.drawRaycasts = drawRaycasts;
|
||||||
|
|
||||||
// First scene
|
// First scene
|
||||||
if (active == null) {
|
if (active == null) {
|
||||||
@ -507,10 +509,12 @@ class PhysicsWorld extends Trait {
|
|||||||
|
|
||||||
public function setDebugDrawMode(debugDrawMode: DebugDrawMode) {
|
public function setDebugDrawMode(debugDrawMode: DebugDrawMode) {
|
||||||
if (debugDrawHelper == null) {
|
if (debugDrawHelper == null) {
|
||||||
if (debugDrawMode == NoDebug) {
|
if (debugDrawMode != NoDebug || this.drawRaycasts) {
|
||||||
|
initDebugDrawing();
|
||||||
|
}
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
initDebugDrawing();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if js
|
#if js
|
||||||
@ -526,7 +530,8 @@ class PhysicsWorld extends Trait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if js
|
#if js
|
||||||
return world.getDebugDrawer().getDebugMode();
|
var drawer = world.getDebugDrawer();
|
||||||
|
if (drawer != null) drawer.setDebugMode(debugDrawMode);
|
||||||
#elseif hl
|
#elseif hl
|
||||||
return hlDebugDrawer_getDebugMode();
|
return hlDebugDrawer_getDebugMode();
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user