In a function I return a created model using CopyMesh(). Up to now I have had one array for these models, and a separate array for Tokamak geometries. I've redesigned this to incorporate both geometry and Tokamak object pointer into a custom type including other properties like this.
Type TOK_actor
; TOK_actors are rigid bodies (rb_TOK...) that interact in motion within the TOK simulation
; They have geometry type, size, position, rotation, and velocity giving motion, ang and lin dampening
Field geom% ; Geometry type, CUBE, SPHERE, PILL
Field model% ; Pointer to geometry
Field TOK_obj% ; Pointer to Tokamak reference
Field siz_x#
Field siz_y#
Field siz_z#
Field pos_x#
Field pos_y#
Field pos_z#
Field rot_x#
Field rot_y#
Field rot_z#
Field vel_x#
Field vel_y#
Field vel_z#
Field linear_damp#
Field angular_damp#
Field material%
Field mass#
End Type I have a function that returns a copy of a mesh depending on parameters with a call such as...
actors(n)=create_geometry_actor(actor.TOK_actor)
Function create_geometry_actor(src.TOK_actor)
entity=copy_mesh(blah blah)
Return entity
End function
This worked fine, but now I have moved the array storing model data into an array of type and reference it thus
actors(n)\model=create_geometry_actor(actor.TOK_actor) I get an "Object does not Exist" error, even though during Debug entity has a value copied from the mesh.
Any clues?
|