예제 #1
0
        public ActionInterfaceWrapper(IAction actionInterface, DynamicsWorld world)
        {
            _actionInterface = actionInterface;
            _world = world;

            _debugDraw = new DebugDrawUnmanagedDelegate(DebugDrawUnmanaged);
            _updateAction = new UpdateActionUnmanagedDelegate(UpdateActionUnmanaged);

            _native = btActionInterfaceWrapper_new(
                Marshal.GetFunctionPointerForDelegate(_debugDraw),
                Marshal.GetFunctionPointerForDelegate(_updateAction));
        }
예제 #2
0
        public ActionInterfaceWrapper(IAction actionInterface, DynamicsWorld world)
        {
            _actionInterface = actionInterface;
            _world           = world;

            _debugDraw    = new DebugDrawUnmanagedDelegate(DebugDrawUnmanaged);
            _updateAction = new UpdateActionUnmanagedDelegate(UpdateActionUnmanaged);

            _native = btActionInterfaceWrapper_new(
                Marshal.GetFunctionPointerForDelegate(_debugDraw),
                Marshal.GetFunctionPointerForDelegate(_updateAction));
        }
예제 #3
0
        public ActionInterfaceWrapper(IAction actionInterface, DynamicsWorld world)
        {
            _actionInterface = actionInterface;
            _world = world;

            _debugDraw = new DebugDrawUnmanagedDelegate(DebugDrawUnmanaged);
            _updateAction = new UpdateActionUnmanagedDelegate(UpdateActionUnmanaged);
            GCHandle handle = GCHandle.Alloc(this, GCHandleType.Normal);
            //UnityEngine.Debug.Log("Created " + GCHandle.ToIntPtr(handle).ToInt64());
            _native = btActionInterfaceWrapper_new(
                Marshal.GetFunctionPointerForDelegate(_debugDraw),
                Marshal.GetFunctionPointerForDelegate(_updateAction),
                GCHandle.ToIntPtr(handle));
            //UnityEngine.Debug.Log("Intptr" + bgActionInterface_getManagedWrapperPntr(_native));
        }
예제 #4
0
        public ActionInterfaceWrapper(IAction actionInterface, DynamicsWorld world)
        {
            _actionInterface = actionInterface;
            _world           = world;

            _debugDraw    = new DebugDrawUnmanagedDelegate(DebugDrawUnmanaged);
            _updateAction = new UpdateActionUnmanagedDelegate(UpdateActionUnmanaged);
            GCHandle handle = GCHandle.Alloc(this, GCHandleType.Normal);

            //UnityEngine.Debug.Log("Created " + GCHandle.ToIntPtr(handle).ToInt64());
            _native = btActionInterfaceWrapper_new(
                Marshal.GetFunctionPointerForDelegate(_debugDraw),
                Marshal.GetFunctionPointerForDelegate(_updateAction),
                GCHandle.ToIntPtr(handle));
            //UnityEngine.Debug.Log("Intptr" + bgActionInterface_getManagedWrapperPntr(_native));
        }