de.mirell.m3d

class C3DObject

Object | +--de.mirell.m3d.C3DObject
Implemented Interfaces: IDrawable, IPositionable, IRotateable, IScaleable, IXMLSerializableAll Known Subclasses: CLine, CModel, CPolygon, CSprite

dynamic class C3DObject extends Object
Base class for any object in 3D space
C3DObject implements various standard behaviours used to render an object based on a list of vertices. C3DObject can not draw itself and acts as an abstract class for other classes like CModel.
  • Author:
    Mirell Development
  • Version:
    1.0
  • See also:

Property Summary

public onPress: Function (read, write)
Set the event method associated with this standard movieclip eventRetrieve the event method associated with this standard movieclip event
public onRollOut: Function (read, write)
Set the event method associated with this standard movieclip eventRetrieve the event method associated with this standard movieclip event
public onRollOver: Function (read, write)
Set the event method associated with this standard movieclip event Retrieve the event method associated with this standard movieclip event

Constructor

public C3DObject ( )
Constructs a new C3DObject instance

Method Summary

public addVertex ( Item: CVertex ): CVertex
Adds the specified vertex to the end of the vertexlist
public createMovieClip ( ): Void
Trigger creation of the object's movieclip
public destroyMovieClip ( ): Void
Trigger removal of the object's movieclip
public draw ( ): Void
Draws the object
public fromXML ( value: XML ): Void
Unserializes XML into the object
public getDisplay ( ): MovieClip
Retrieve the movieclip the object draws itself on
public getMovieClip ( ): MovieClip
Retrieve the object's movieclip
public getParent ( ): Object
Retrieves the object associated as the parent of the object
public getPosition ( ): CCoordinate
Retrieves the current center point of the object
public getRotation ( ): CQuaternion
Retrieves the current rotation of the object
public getType ( ): String
Retrieve the type of the object
public getVertices ( ): Array
Retrieve the vertices of the object
public hasFaces ( ): Boolean
Determine if object has faces
public hasVertices ( ): Boolean
Determine if object has vertices
public isChanged ( ): Boolean
Determines if object needs to be redrawn
public removeVertex ( Item: CVertex ): Void
Removes the specified vertex from the vertexlist
public rotate ( Value: CQuaternion ): Void
Rotate the object using a quaternion
public scale ( Value: CCoordinate ): Void
Scale the object in space
public setDisplay ( display: MovieClip ): Void
Set the movieclip to draw the object on
public setParent ( Parent: Object ): Void
Associates an object as the parent of this
public setPosition ( Value: CCoordinate ): Void
Sets the center point of the object
public setRotation ( Value: CQuaternion ): Void
Set the current rotation of the object
public toXML ( ): XML
Serializes the object into XML
public translate ( Value: CCoordinate ): Void
Translate the position of the object

Property Documentation

onPress

public onPress: Function (read, write)
Set the event method associated with this standard movieclip eventRetrieve the event method associated with this standard movieclip event

    onRollOut

    public onRollOut: Function (read, write)
    Set the event method associated with this standard movieclip eventRetrieve the event method associated with this standard movieclip event

      onRollOver

      public onRollOver: Function (read, write)
      Set the event method associated with this standard movieclip event Retrieve the event method associated with this standard movieclip event

        Constructor Documentation

        C3DObject

        public function C3DObject (
        )
        Constructs a new C3DObject instance
        The instance is positioned at (0,0,0) with no vertices assigned.

        Method Documentation

        addVertex

        public function addVertex (
        Item: CVertex): CVertex
        Adds the specified vertex to the end of the vertexlist
        The vertex is not added if already in the vertexlist of the object
        • Parameters:
          Item
          The CVertex to add to the vertices of the object
        • Returns:
          Returns the added vertex

        createMovieClip

        public function createMovieClip (
        ): Void
        Trigger creation of the object's movieclip
        If a Display was set a new movieclip is created and the target for all drawing operations of the object

          destroyMovieClip

          public function destroyMovieClip (
          ): Void
          Trigger removal of the object's movieclip
          Remove the movie created from a prior call to createMovieClip

            draw

            public function draw (
            ): Void
            Draws the object
            This method is called from the renderer when the object needs to draw itself.

            fromXML

            public function fromXML (
            value: XML): Void
            Unserializes XML into the object
            Object state is set according to XML.

            getDisplay

            public function getDisplay (
            ): MovieClip
            Retrieve the movieclip the object draws itself on
            • Returns:
              The movieclip the object draws itself on

            getMovieClip

            public function getMovieClip (
            ): MovieClip
            Retrieve the object's movieclip
            The movie is created from a call to createMovieClip and is used for drawing operations

              getParent

              public function getParent (
              ): Object
              Retrieves the object associated as the parent of the object
              • Returns:
                The object to be considered as parent of the object

              getPosition

              public function getPosition (
              ): CCoordinate
              Retrieves the current center point of the object

              getRotation

              public function getRotation (
              ): CQuaternion
              Retrieves the current rotation of the object

              getType

              public function getType (
              ): String
              Retrieve the type of the object
              • Returns:
                The classname of the object

              getVertices

              public function getVertices (
              ): Array
              Retrieve the vertices of the object
              • Returns:
                Returns the vertices of the object in the current state

              hasFaces

              public function hasFaces (
              ): Boolean
              Determine if object has faces
              • Returns:
                Returns True if the object has faces

              hasVertices

              public function hasVertices (
              ): Boolean
              Determine if object has vertices
              • Returns:
                Returns True if the object has vertices

              isChanged

              public function isChanged (
              ): Boolean
              Determines if object needs to be redrawn
              If any relevant state within the object (e.g.: vertexlist) is changed since the last call to C3DEngine.render
              • Returns:
                True if the object's state has changed since the last call to C3DEngine.render

              removeVertex

              public function removeVertex (
              Item: CVertex): Void
              Removes the specified vertex from the vertexlist
              All vertices are shifted up in the vertex array of the object
              • Parameters:
                Item
                Vertex to be removed

              rotate

              public function rotate (
              Value: CQuaternion): Void
              Rotate the object using a quaternion
              • Specified by:
                rotate in interface IRotateable
              • Parameters:
                Value
                The amount to rotate the object set using a CQuaternion

              scale

              public function scale (
              Value: CCoordinate): Void
              Scale the object in space

              setDisplay

              public function setDisplay (
              display: MovieClip): Void
              Set the movieclip to draw the object on
              • Parameters:
                display
                Target movieclip for drawing operations

              setParent

              public function setParent (
              Parent: Object): Void
              Associates an object as the parent of this
              Used to traverse object relation trees. Usefull for a vertex to determine it's parent object it belongs to.
              • Parameters:
                Parent
                The object to be considered as parent of the object

              setPosition

              public function setPosition (
              Value: CCoordinate): Void
              Sets the center point of the object

              setRotation

              public function setRotation (
              Value: CQuaternion): Void
              Set the current rotation of the object
              • Specified by:
              • Parameters:
                Value
                The rotation of the object specfied by a CQuaternion

              toXML

              public function toXML (
              ): XML
              Serializes the object into XML
              The current object state will be serialized. The fromXML method must be able to unserialize the XML.

              translate

              public function translate (
              Value: CCoordinate): Void
              Translate the position of the object

              The documentation was generated from the following file: