Пример #1
0
    public static PhysicsClient CreatePhysicsClientSharedMemory()
    {
        PhysicsClient pc = new PhysicsClient();

        pc._native = NativeMethods.b3ConnectSharedMemory(NativeConstants.SHARED_MEMORY_KEY);
        return(pc);
    }
Пример #2
0
    public static PhysicsClient CreatePhysicsClientDirect()
    {
        PhysicsClient pc = new PhysicsClient();

        pc._native = NativeMethods.b3ConnectPhysicsDirect();
        return(pc);
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("start begin");
        Debug.Log("bb");
        bodies   = new List <Robot1>();
        pybullet = PhysicsClient.CreatePhysicsClientSharedMemory();
        if (!pybullet.CanSubmitCommand())
        {
            pybullet = PhysicsClient.CreatePhysicsClientDirect();
        }
        pybullet.SetGravity(Physics.gravity);

        Robot1 cube = CreateRobot("quadruped/minitaur", new Vector3(0, 15, 0), Quaternion.Euler(35, 0, 0));

        //Robot1 plane = CreateRobot("plane", Vector3.zero, Quaternion.Euler(-90, 0, 0));
        bodies.Add(cube);
        //bodies.Add(plane);
    }
Пример #4
0
    public CommandStatus SubmitClientCommandAndWaitStatus(PhysicsClient command)
    {
        IntPtr cmd = NativeMethods.b3SubmitClientCommandAndWaitStatus(_native, command._native);

        return(new CommandStatus(cmd));
    }