# Palomino - Object Module

©2004,2009 Jim E. Brooks http://www.palomino3d.org

- Index
- Overview
- Object Destruction

- DestroyObject Event

## Overview

[2008/02]

This modules has the Object classes (Object/Dyna/Craft) and auxillary classes (AxisMap,RotationList).

### Object Derivatives

- Object:
  The base Object has minimum functionality for a small footprint to support a multitude of objects.
- Dyna:
  Dyna is for "dynamic" objects. Dyna is derived from Object.
  Dyna has a timer-tick method for animation.
- Craft: Craft is derived from Dyna.
  Craft has a throttle, Physics object that moves the Craft, and CraftSpecs which define a craft's specifications (mass,thrust,etc) used by Physics.

## Object Destruction

[2008/11]

Related states are collided, detached, and crashed, but those don't necessarily mean the Object has to be deleted from memory.

Since Objects are referenced-counted, they cannot be directly deleted. Rather, Objects are scheduled for deletion by Object::Zombify(). This method will set a zombie flag, then broadcast a DestroyObject Event to release all references to it. The event is propagated to Lua too as Lua can hold C++ objects as Lua userdata objects.

Of course, there probably will be places in the code that fail to listen to that event. As a mitigation to at least reduce memory, Object::Zombify() will detach from World a zombie's Graph, and replace it with a minimal Graph.

Last modified: Sat Nov 7 14:54:34 CST 2009