Example #1
0
        public static uint SurfaceObjectCreate(Vector3 position, Quaternion rotation, SM64Surface[] surfaces)
        {
            var surfListHandle = GCHandle.Alloc(surfaces, GCHandleType.Pinned);
            var t = SM64ObjectTransform.FromUnityWorld(position, rotation);

            SM64SurfaceObject surfObj = new SM64SurfaceObject
            {
                transform    = t,
                surfaceCount = (uint)surfaces.Length,
                surfaces     = surfListHandle.AddrOfPinnedObject()
            };

            uint result = sm64_surface_object_create(ref surfObj);

            surfListHandle.Free();

            return(result);
        }
Example #2
0
        public static void SurfaceObjectMove(uint id, Vector3 position, Quaternion rotation)
        {
            var t = SM64ObjectTransform.FromUnityWorld(position, rotation);

            sm64_surface_object_move(id, ref t);
        }