Focus pr on explicit type and util changes
This commit is contained in:
parent
205e602080
commit
be91fe9120
15 changed files with 18 additions and 856 deletions
|
|
@ -73,98 +73,6 @@ public unsafe struct Model
|
|||
/// Bones base transformation (pose, Transform *)
|
||||
/// </summary>
|
||||
public Transform* BindPose;
|
||||
|
||||
public readonly CBool IsValid => Raylib.IsModelValid(this);
|
||||
|
||||
public static Model Load(string fileName)
|
||||
{
|
||||
return Raylib.LoadModel(fileName);
|
||||
}
|
||||
|
||||
public static Model LoadFromMesh(Mesh mesh)
|
||||
{
|
||||
return Raylib.LoadModelFromMesh(mesh);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position)
|
||||
{
|
||||
Raylib.DrawModel(this, position, 1.0f, Color.White);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position, float scale)
|
||||
{
|
||||
Raylib.DrawModel(this, position, scale, Color.White);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position, float scale, Color color)
|
||||
{
|
||||
Raylib.DrawModel(this, position, scale, color);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position, Vector3 rotationAxis, float rotationAngle)
|
||||
{
|
||||
Raylib.DrawModelEx(this, position, rotationAxis, rotationAngle, Vector3.One, Color.White);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale)
|
||||
{
|
||||
Raylib.DrawModelEx(this, position, rotationAxis, rotationAngle, scale, Color.White);
|
||||
}
|
||||
|
||||
public readonly void Draw(Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color)
|
||||
{
|
||||
Raylib.DrawModelEx(this, position, rotationAxis, rotationAngle, scale, color);
|
||||
}
|
||||
|
||||
public readonly void DrawWires(Vector3 position, Color color)
|
||||
{
|
||||
Raylib.DrawModelWires(this, position, 1.0f, color);
|
||||
}
|
||||
|
||||
public readonly void DrawWires(Vector3 position, float scale)
|
||||
{
|
||||
Raylib.DrawModelWires(this, position, scale, Color.White);
|
||||
}
|
||||
|
||||
public readonly void DrawWires(Vector3 position, float scale, Color color)
|
||||
{
|
||||
Raylib.DrawModelWires(this, position, scale, color);
|
||||
}
|
||||
|
||||
public readonly void DrawWires(Vector3 position, Vector3 rotationAxis, float rotationAngle, Color color)
|
||||
{
|
||||
Raylib.DrawModelWiresEx(this, position, rotationAxis, rotationAngle, Vector3.One, color);
|
||||
}
|
||||
|
||||
public readonly void DrawWires(Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color)
|
||||
{
|
||||
Raylib.DrawModelWiresEx(this, position, rotationAxis, rotationAngle, scale, color);
|
||||
}
|
||||
|
||||
public readonly void DrawPoints(Vector3 position, Color color)
|
||||
{
|
||||
Raylib.DrawModelPoints(this, position, 1.0f, color);
|
||||
}
|
||||
|
||||
public readonly void DrawPoints(Vector3 position, float scale, Color color)
|
||||
{
|
||||
Raylib.DrawModelPoints(this, position, scale, color);
|
||||
}
|
||||
|
||||
public readonly void DrawPoints(Vector3 position, Vector3 rotationAxis, float rotationAngle, Color color)
|
||||
{
|
||||
Raylib.DrawModelPointsEx(this, position, rotationAxis, rotationAngle, Vector3.One, color);
|
||||
}
|
||||
|
||||
public readonly void DrawPoints(Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color)
|
||||
{
|
||||
Raylib.DrawModelPointsEx(this, position, rotationAxis, rotationAngle, scale, color);
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
Raylib.UnloadModel(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -223,31 +131,6 @@ public unsafe struct ModelAnimation
|
|||
this._boneCount = boneCount;
|
||||
}
|
||||
}
|
||||
|
||||
public static ModelAnimation[] LoadAnimations(string fileName)
|
||||
{
|
||||
int count = 0;
|
||||
ModelAnimation* animations = Raylib.LoadModelAnimations(fileName, ref count);
|
||||
ModelAnimation[] output = new ModelAnimation[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
output[i] = animations[i];
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static void UnloadAnimations(ModelAnimation[] modelAnimations)
|
||||
{
|
||||
fixed (ModelAnimation* ptr = modelAnimations)
|
||||
{
|
||||
Raylib.UnloadModelAnimations(ptr, modelAnimations.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
Raylib.UnloadModelAnimation(this);
|
||||
}
|
||||
}
|
||||
|
||||
public readonly unsafe struct FramePoses
|
||||
|
|
|
|||
Loading…
Reference in a new issue