
import OimoRigidBody from "../Oimo/OimoRigibody";
import OimoBodyData from "../Oimo/OimoBodyData";
export default class PassivityBehaviour extends OimoRigidBody {

    public constructor() {
        super();
    }

    // private disZ: number = 35;
    // private disY: number = -2;
    // private speed: number = 500;
    // private tempvev: Laya.Vector3 = new Laya.Vector3();
    // private velocity: Laya.Vector3;
    // private tragetZ: number = 0;
    // private force: Laya.Vector3 = new Laya.Vector3();
    public init(data?: OimoBodyData) {
        if (!data) data = new OimoBodyData();
        data.move = true;
        super.init(data);
    }
    // public setData(vec: Laya.Vector3) {
    //     this.velocity = vec;
    //     this.tragetZ = this.transform.position.z + this.disZ;
    //     let pos = this.transform.position;
    //     let forceVec3 = new OIMO.Vec3(vec.x, vec.y, vec.z * 300);
    //     let posVec3 = new OIMO.Vec3(pos.x, pos.y, pos.z);
    //     this.body.applyImpulse(posVec3, forceVec3);
    // }

    public onAwake() {

    }

    public onStart() {
    }

    public onUpdate() {
        super.onUpdate();

      //  super.checkContact(1111);
    }

    public onDisable() {

        if (this.body && this.body.parent) this.body.dispose();
        this.body = null;
    }

}