Entity Code

Previous topic - Next topic

matty47

Gernot,
I tried the entity code from the German forum. My model displays ok but it doesn't seem to move ( as the code would suggest). I added some functions to get the position of the entity and displayed this on the screen. The position value of the entity changes on each loop so I can only think that the X-Multmatrix or the X-Drawanim instructions are not working (for me anyway). This code looks like a good start to a scene manager library. Any ideas??
Code I added to Entity.gbas
Code (glbasic) Select
// ------------------------------------------ //
//! Return the x position of the entity
// ------------------------------------------ //
FUNCTION GetEntityX: entity
RETURN g3DObj[entity].x
ENDFUNCTION

// ------------------------------------------ //
//! Return the y position of the entity
// ------------------------------------------ //
FUNCTION GetEntityY: entity
RETURN g3DObj[entity].y
ENDFUNCTION

// ------------------------------------------ //
//! Return the z position of the entity
// ------------------------------------------ //
FUNCTION GetEntityZ: entity
RETURN g3DObj[entity].z
ENDFUNCTION
Thanks
Matthew

Kitty Hello

Right. There was a typo. Get the updated text again, please.

matty47

Thanks ,that fixed it . I could not find what was going wrong in the original code. I'll compare the new to find it.( a learning experience)
Matthew

Kitty Hello

The Function: UpdateMatrix...