Exemple #1
0
            public override void SetWorldTransform(ref BulletMatrix worldTrans)
            {
                if (worldTrans.M42 < Game.Workspace.VoidHeight)
                {
                    _part.Destroy();
                    return;
                }

                _part._cframe      = (CFrame)worldTrans;
                _part._modelMatrix = DirectXUtil.BulletMatrixToSharpDX(_part.RigidBody.InterpolationWorldTransform);
                _part.UpdateRenderData();
                _part.Moved.Fire();
            }
Exemple #2
0
        private void LoadBitmap(System.Drawing.Bitmap bitmap, BindFlags flags)
        {
            var texDesc = new Texture2DDescription
            {
                Width             = bitmap.Width,
                Height            = bitmap.Height,
                ArraySize         = 1,
                BindFlags         = flags,
                Usage             = ResourceUsage.Immutable,
                CpuAccessFlags    = CpuAccessFlags.None,
                Format            = Format.R8G8B8A8_UNorm,
                MipLevels         = 1,
                OptionFlags       = ResourceOptionFlags.None,
                SampleDescription = new SampleDescription(1, 0)
            };

            var rect = DirectXUtil.LoadBitmapData(bitmap);

            NativeTexture = new Texture2D(Renderer.Device, texDesc, rect);
        }