|
@@ -6,6 +6,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
import { Vector3, Quaternion } from "../../Maths/math";
|
|
import { Vector3, Quaternion } from "../../Maths/math";
|
|
import { Nullable } from "../../types";
|
|
import { Nullable } from "../../types";
|
|
import { Logger } from "../../Misc/logger";
|
|
import { Logger } from "../../Misc/logger";
|
|
|
|
+import { PhysicsRaycastResult } from "../physicsRaycastResult";
|
|
|
|
|
|
declare var OIMO: any;
|
|
declare var OIMO: any;
|
|
|
|
|
|
@@ -15,6 +16,7 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
|
|
public world: any;
|
|
public world: any;
|
|
public name: string = "OimoJSPlugin";
|
|
public name: string = "OimoJSPlugin";
|
|
public BJSOIMO: any;
|
|
public BJSOIMO: any;
|
|
|
|
+ private _raycastResult: PhysicsRaycastResult;
|
|
|
|
|
|
constructor(iterations?: number, oimoInjection = OIMO) {
|
|
constructor(iterations?: number, oimoInjection = OIMO) {
|
|
this.BJSOIMO = oimoInjection;
|
|
this.BJSOIMO = oimoInjection;
|
|
@@ -22,6 +24,7 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
|
|
iterations: iterations
|
|
iterations: iterations
|
|
});
|
|
});
|
|
this.world.clear();
|
|
this.world.clear();
|
|
|
|
+ this._raycastResult = new PhysicsRaycastResult();
|
|
}
|
|
}
|
|
|
|
|
|
public setGravity(gravity: Vector3) {
|
|
public setGravity(gravity: Vector3) {
|
|
@@ -479,7 +482,11 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
|
|
* @param from when should the ray start?
|
|
* @param from when should the ray start?
|
|
* @param to when should the ray end?
|
|
* @param to when should the ray end?
|
|
*/
|
|
*/
|
|
- public raycast(from: Vector3, to: Vector3) {
|
|
|
|
|
|
+ public raycast(from: Vector3, to: Vector3): PhysicsRaycastResult {
|
|
Logger.Warn("raycast is not currently supported by the Oimo physics plugin");
|
|
Logger.Warn("raycast is not currently supported by the Oimo physics plugin");
|
|
|
|
+
|
|
|
|
+ this._raycastResult.reset(from, to);
|
|
|
|
+
|
|
|
|
+ return this._raycastResult;
|
|
}
|
|
}
|
|
}
|
|
}
|