Hello,
I am using the Dark GDK .NET with C# and I'm having a problem with the limbs. First off, when I use Object3D.PerformChecklistForLimbs() I am able to retrieve the total amount of limbs and the limb names with the Checklist class, as to be expected. However, when I use Object3D.Limbs.Count, it only returns 1 when I know the object has more than 1 limb, because the Checklist.ChecklistQuantity returns the correct number of limbs (tried with the DarkMatter models and my own models). I also did checked the name of that limb, using Object3D.Limbs[0].Name, and it returned a blank string. I also tried calling Object3D.EnumerateLimbs() before calling Object3D.Limbs.Count, however, this gave me a NotSupportedException:
"Collection is read-only."
Here is my code (Object3D.EnumerateLimbs() removed):
using System;
using DarkGDK;
using DarkGDK.Animation;
using DarkGDK.Audio;
using DarkGDK.Basic2D;
using DarkGDK.Basic3D;
using DarkGDK.Camera;
using DarkGDK.IO;
using DarkGDK.Lighting;
using DarkGDK.Math;
using DarkGDK.Net;
using DarkGDK.Particle;
using DarkGDK.World;
public class DGDK
{
Object3D model;
/// <summary>
/// Constructor
/// </summary>
public DGDK()
{
// Initialize the Dark-GDK engine.
Engine.InitializeGDK();
Display.SetDisplayMode(640, 480, 32);
Display.FullScreen = false;
// Turn sync on.
Core.SyncOn();
Core.SyncRate(60);
model = new Object3D("Models/H-Small Car Red-Move.x");
model.PerformCheckListForLimbs();
for (int i = 1; i <= Checklist.ChecklistQuantity; i++)
{
Console.WriteLine(Checklist.ChecklistString(i));
}
Console.WriteLine("Limb Count: " + model.Limbs.Count);
// Main Loop
while (Engine.LoopGDK)
{
// Call the main game loop.
GameLoop();
// Sync the screen.
Core.Sync();
}
}
/// <summary>
/// Main Game Loop
/// </summary>
private void GameLoop()
{
model.RotateRelative(0, 1, 0);
}
/// <summary>
/// Entry Point
/// </summary>
public static void Main()
{
new DGDK();
}
}
Here is the output from the console:
x3ds_BODY______
x3ds_UNDERNEATH
x3ds_WHEEL_fl
x3ds_WHEEL_br
x3ds_WHEEL_bl
x3ds_WHEEL_fr
Limb Count: 1