| Package | org.papervision3d.objects.parsers |
| Class | public class MD2 |
| Inheritance | MD2 TriangleMesh3D Vertices3D DisplayObject3D DisplayObjectContainer3D flash.events.EventDispatcher |
| Implements | IAnimatable, IAnimationDataProvider |
| Property | Defined by | ||
|---|---|---|---|
![]() | alpha : Number = 1 | DisplayObject3D | |
![]() | autoCalcScreenCoords : Boolean | DisplayObject3D | |
![]() | blendMode : String = "normal" | DisplayObject3D | |
![]() | children : Object
Returns the children object.
| DisplayObjectContainer3D | |
![]() | container : ViewportLayer | DisplayObject3D | |
![]() | culled : Boolean
[internal use] Is this object culled by camera frustum?
| DisplayObject3D | |
![]() | cullTest : Number = 0 | DisplayObject3D | |
![]() | extra : Object
An object that contains user defined properties.
| DisplayObject3D | |
![]() | faceLevelMode : Boolean [static]
This allows objects faces to have their own containers.
| DisplayObject3D | |
![]() | faces : Array
[internal-use]
| DisplayObject3D | |
![]() | filters : Array | DisplayObject3D | |
![]() | flipLightDirection : Boolean = false | DisplayObject3D | |
| fps : uint [read-only]
Gets the default FPS.
| MD2 | ||
![]() | frustumTestMethod : int = 0 | DisplayObject3D | |
![]() | geometry : GeometryObject3D
The GeometryObject3D object that contains the 3D definition of this instance.
| DisplayObject3D | |
![]() | id : int
[read-only] Unique id of this instance.
| DisplayObject3D | |
![]() | localRotationX : Number | DisplayObject3D | |
![]() | localRotationY : Number | DisplayObject3D | |
![]() | localRotationZ : Number | DisplayObject3D | |
![]() | material : MaterialObject3D | TriangleMesh3D | |
![]() | materials : MaterialsList
The list of materials for this instance.
| DisplayObject3D | |
![]() | meshSort : uint = 1
tells Mesh3D's render() method to compare the measurement choice of the user for a triangle's sorting
| DisplayObject3D | |
![]() | name : String
An optional object name.
| DisplayObject3D | |
![]() | numChildren : int
Returns the number of children of this object.
| DisplayObjectContainer3D | |
![]() | parent : DisplayObjectContainer3D
[read-only] Indicates the DisplayObjectContainer3D object that contains this display object.
| DisplayObject3D | |
![]() | parentContainer : DisplayObject3D | DisplayObject3D | |
![]() | position : Number3D
A Number3D containing the current x, y, and z of the DisplayObject3D
| DisplayObject3D | |
![]() | root : DisplayObjectContainer3D
[read-only] [read-only] The scene, which is the top-most displayObjectContainer3D in the tree structure.
| DisplayObjectContainer3D | |
![]() | rotationX : Number
Specifies the rotation around the X axis from its original orientation.
| DisplayObject3D | |
![]() | rotationY : Number
Specifies the rotation around the Y axis from its original orientation.
| DisplayObject3D | |
![]() | rotationZ : Number
Specifies the rotation around the Z axis from its original orientation.
| DisplayObject3D | |
![]() | scale : Number
Sets the 3D scale as applied from the registration point of the object.
| DisplayObject3D | |
![]() | scaleX : Number
Sets the scale along the local X axis as applied from the registration point of the object.
| DisplayObject3D | |
![]() | scaleY : Number
Sets the scale along the local Y axis as applied from the registration point of the object.
| DisplayObject3D | |
![]() | scaleZ : Number
Sets the scale along the local Z axis as applied from the registration point of the object.
| DisplayObject3D | |
![]() | scene : SceneObject3D | DisplayObject3D | |
![]() | sceneX : Number
The X coordinate of a object relative to the scene coordinate system.
| DisplayObject3D | |
![]() | sceneY : Number
The Y coordinate of a object relative to the scene coordinate system.
| DisplayObject3D | |
![]() | sceneZ : Number
The Z coordinate of a object relative to the scene coordinate system.
| DisplayObject3D | |
![]() | screen : Number3D
[read-only] The coordinate of the object on screen.
| DisplayObject3D | |
![]() | screenZ : Number
[internal-use] The average depth of the object faces center.
| DisplayObject3D | |
![]() | sortedArray : Array [static]
| DisplayObject3D | |
![]() | testQuad : Boolean = true | DisplayObject3D | |
![]() | transform : Matrix3D
A Matrix3D object containing values that affect the scaling, rotation, and translation of the display object.
| DisplayObject3D | |
![]() | useClipping : Boolean = true | DisplayObject3D | |
![]() | useOwnContainer : Boolean | DisplayObject3D | |
![]() | userData : UserData | DisplayObject3D | |
![]() | view : Matrix3D
[internal-use] A camera transformed Matrix3D object.
| DisplayObject3D | |
![]() | visible : Boolean
Whether or not the display object is visible.
| DisplayObject3D | |
![]() | world : Matrix3D
World transformation.
| DisplayObject3D | |
![]() | x : Number
An Number that sets the X coordinate of a object relative to the origin of its parent.
| DisplayObject3D | |
![]() | y : Number
An Number that sets the Y coordinate of a object relative to the origin of its parent.
| DisplayObject3D | |
![]() | z : Number
An Number that sets the Z coordinate of a object relative to the origin of its parent.
| DisplayObject3D | |
![]() | ZERO : DisplayObject3D
[static]
Returns an empty DiplayObject3D object positioned in the center of the 3D coordinate system (0, 0 ,0).
| DisplayObject3D | |
| Property | Defined by | ||
|---|---|---|---|
| _autoPlay : Boolean | MD2 | ||
| _channelByName : Object | MD2 | ||
| _channels : Array | MD2 | ||
![]() | _children : Dictionary
[internal-use] Names indexed by children.
| DisplayObjectContainer3D | |
![]() | _childrenByName : Object
[internal-use] Children indexed by name.
| DisplayObjectContainer3D | |
| _currentChannel : AbstractChannel3D | MD2 | ||
| _currentTime : Number = 0 | MD2 | ||
| file : String
Variables used in the loading of the file
| MD2 | ||
| _fps : int | MD2 | ||
| framesize : int | MD2 | ||
| ident : int
MD2 Header data
These are all the variables found in the md2_header_t
C style struct that starts every MD2 file.
| MD2 | ||
| _isPlaying : Boolean = false | MD2 | ||
| loader : URLLoader | MD2 | ||
| loadScale : Number | MD2 | ||
| num_skins : int | MD2 | ||
| num_tris : int | MD2 | ||
| offset_frames : int | MD2 | ||
| offset_skins : int | MD2 | ||
![]() | _scene : SceneObject3D = null
The scene where the object belongs.
| DisplayObject3D | |
| skinwidth : int | MD2 | ||
![]() | _sorted : Array | DisplayObject3D | |
![]() | _transformDirty : Boolean = false
[internal-use]
| DisplayObject3D | |
![]() | _useOwnContainer : Boolean = false | DisplayObject3D | |
![]() | _userData : UserData | DisplayObject3D | |
| Method | Defined by | ||
|---|---|---|---|
|
MD2(autoPlay:Boolean = true)
Constructor.
| MD2 | ||
![]() |
Adds a child DisplayObject3D instance to this DisplayObjectContainer instance.
| DisplayObject3D | |
![]() |
Adds all the children of a DisplayObject3D instance to this DisplayObjectContainer instance.
| DisplayObjectContainer3D | |
![]() | DisplayObject3D | ||
![]() |
addGeometry(geometry:GeometryObject3D = null):void
Adds a geometry definition to the instance.
| DisplayObject3D | |
![]() |
boundingBox():Object
Calculates 3D bounding box.
| Vertices3D | |
![]() |
calculateScreenCoords(camera:CameraObject3D):void
| DisplayObject3D | |
![]() |
childrenList():String
Returns a string value with the list of objects.
| DisplayObjectContainer3D | |
![]() |
Clones this object.
| TriangleMesh3D | |
![]() |
copyPosition(reference:*):void
Copies the position information (x, y and z coordinates) from another object or Matrix3D.
| DisplayObject3D | |
![]() |
copyTransform(reference:*):void
Copies the transformation information (position, rotation and scale) from another object or Matrix3D.
| DisplayObject3D | |
![]() |
createRenderTriangle(face:Triangle3D, material:MaterialObject3D, v0:Vertex3DInstance, v1:Vertex3DInstance, v2:Vertex3DInstance, uv0:NumberUV, uv1:NumberUV, uv2:NumberUV):RenderTriangle
| TriangleMesh3D | |
![]() | DisplayObject3D | ||
![]() |
distanceTo(obj:DisplayObject3D):Number
Gets the distance to the position of the given object.
| DisplayObject3D | |
|
getAnimationChannelByName(name:String):AbstractChannel3D
Gets a animation channel by its name.
| MD2 | ||
|
getAnimationChannels(target:DisplayObject3D = null):Array
Gets all animation channels for a target.
| MD2 | ||
|
getAnimationChannelsByClip(name:String):Array
Gets animation channels by clip name.
| MD2 | ||
![]() |
getChildByName(name:String, recursive:Boolean = false):DisplayObject3D
Returns the child display object that exists with the specified name.
| DisplayObjectContainer3D | |
![]() |
getMaterialByName(name:String):MaterialObject3D
Returns the material that exists with the specified name in the materials list.
| DisplayObject3D | |
![]() |
hitTestObject(obj:DisplayObject3D, multiplier:Number = 1):Boolean
Evaluates the display object to see if it overlaps or intersects with the obj display object.
| DisplayObject3D | |
![]() |
hitTestPoint(x:Number, y:Number, z:Number):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x, y and z parameters.
| DisplayObject3D | |
|
load(asset:*, material:MaterialObject3D = null, fps:int = 6, scale:Number = 1):void
Loads the MD2.
| MD2 | ||
![]() |
Make the object look at a specific position.
| DisplayObject3D | |
![]() |
materialsList():String
Returns a string value with the list of material names of the materials list.
| DisplayObject3D | |
![]() |
mergeVertices():void
Merges duplicated vertices.
| TriangleMesh3D | |
![]() |
moveBackward(distance:Number):void
Translate the display object in the opposite direction it is facing, i.e.
| DisplayObject3D | |
![]() |
moveDown(distance:Number):void
Translate the display object downwards, with respect to the direction it is facing, i.e.
| DisplayObject3D | |
![]() |
moveForward(distance:Number):void
Translate the display object in the direction it is facing, i.e.
| DisplayObject3D | |
![]() |
moveLeft(distance:Number):void
Translate the display object lateraly, to the left of the direction it is facing, i.e.
| DisplayObject3D | |
![]() |
moveRight(distance:Number):void
Translate the display object lateraly, to the right of the direction it is facing, i.e.
| DisplayObject3D | |
![]() |
moveUp(distance:Number):void
Translate the display object upwards, with respect to the direction it is facing, i.e.
| DisplayObject3D | |
![]() |
pitch(angle:Number):void
Rotate the display object around its lateral or transverse axis —an axis running from the pilot's left to right in piloted aircraft, and parallel to the wings of a winged aircraft; thus the nose pitches up and the tail down, or vice-versa.
| DisplayObject3D | |
|
play(clip:String = null):void
Plays the animation.
| MD2 | ||
|
Project.
| MD2 | ||
![]() | Vertices3D | ||
![]() |
| Vertices3D | |
![]() |
projectTexture(u:String = "x", v:String = "y"):void
Planar projection from the specified plane.
| TriangleMesh3D | |
![]() |
quarterFaces():void
Divides all faces into 4.
| TriangleMesh3D | |
![]() |
Removes the specified child DisplayObject3D instance from the child list of the DisplayObjectContainer3D instance.
| DisplayObjectContainer3D | |
![]() |
removeChildByName(name:String):DisplayObject3D
Removes the child DisplayObject3D instance that exists with the specified name, from the child list of the DisplayObjectContainer3D instance.
| DisplayObjectContainer3D | |
![]() |
replaceMaterialByName(material:MaterialObject3D, name:String):void
Replaces a material by its name.
| DisplayObject3D | |
![]() |
roll(angle:Number):void
Rotate the display object around the longitudinal axis —an axis drawn through the body of the vehicle from tail to nose in the normal direction of flight, or the direction the object is facing.
| DisplayObject3D | |
![]() |
setChildMaterial(child:DisplayObject3D, material:MaterialObject3D, existingMaterial:MaterialObject3D = null):void
Sets the material for a child DisplayObject3D.
| DisplayObject3D | |
![]() |
setChildMaterialByName(childName:String, material:MaterialObject3D):void
Sets the material for a child DisplayObject3D by the child's name.
| DisplayObject3D | |
|
stop():void
Stops the animation.
| MD2 | ||
![]() |
toString():String
Returns a string value representing the three-dimensional position values of the display object instance.
| DisplayObject3D | |
![]() |
transformVertices(transformation:Matrix3D):void
| Vertices3D | |
![]() |
Move the object along a given direction.
| DisplayObject3D | |
![]() |
updateTransform():void
[internal-use] Updates the transform Matrix3D with the current rotation and scale values.
| DisplayObject3D | |
![]() |
yaw(angle:Number):void
Rotate the display object around about the vertical axis —an axis drawn from top to bottom.
| DisplayObject3D | |
| Method | Defined by | ||
|---|---|---|---|
|
loadCompleteHandler(event:Event):void
| MD2 | ||
|
loadProgressHandler(event:ProgressEvent):void
| MD2 | ||
|
parse(data:ByteArray):void
Parses the MD2 file. | MD2 | ||
|
readFrames(data:ByteArray):void
Reads in all the frames
| MD2 | ||
|
readMd2Header(data:ByteArray):void
Reads in all that MD2 Header data that is declared as private variables.
| MD2 | ||
![]() |
setParentContainer(parent:DisplayObject3D, assign:Boolean = true):void
| DisplayObject3D | |
![]() |
setScreenZ(meshSort:uint, vertex0:Vertex3DInstance, vertex1:Vertex3DInstance, vertex2:Vertex3DInstance):Number
| TriangleMesh3D | |
| _autoPlay | property |
protected var _autoPlay:Boolean
| _channelByName | property |
protected var _channelByName:Object
| _channels | property |
protected var _channels:Array
| _currentChannel | property |
protected var _currentChannel:AbstractChannel3D
| _currentTime | property |
protected var _currentTime:Number = 0
| file | property |
protected var file:StringVariables used in the loading of the file
| _fps | property |
protected var _fps:int
| fps | property |
fps:uint [read-only]Gets the default FPS.
Implementation public function get fps():uint
| framesize | property |
protected var framesize:int
| ident | property |
protected var ident:intMD2 Header data These are all the variables found in the md2_header_t C style struct that starts every MD2 file.
| _isPlaying | property |
protected var _isPlaying:Boolean = false
| loader | property |
protected var loader:URLLoader
| loadScale | property |
protected var loadScale:Number
| num_skins | property |
protected var num_skins:int
| num_tris | property |
protected var num_tris:int
| offset_frames | property |
protected var offset_frames:int
| offset_skins | property |
protected var offset_skins:int
| skinwidth | property |
protected var skinwidth:int
| MD2 | () | constructor |
public function MD2(autoPlay:Boolean = true)Constructor.
ParametersautoPlay:Boolean (default = true) — Whether to start the animation automatically.
|
| getAnimationChannelByName | () | method |
public function getAnimationChannelByName(name:String):AbstractChannel3DGets a animation channel by its name.
Parametersname:String |
AbstractChannel3D —
the found channel.
|
| getAnimationChannels | () | method |
public function getAnimationChannels(target:DisplayObject3D = null):ArrayGets all animation channels for a target. NOTE: when target is null, 'this' object is used.
Parameterstarget:DisplayObject3D (default = null) — The target to get the channels for.
|
Array — Array of AnimationChannel3D.
|
| getAnimationChannelsByClip | () | method |
public function getAnimationChannelsByClip(name:String):ArrayGets animation channels by clip name.
Parametersname:String — The clip name
|
Array — Array of AnimationChannel3D.
|
| load | () | method |
public function load(asset:*, material:MaterialObject3D = null, fps:int = 6, scale:Number = 1):voidLoads the MD2.
Parametersasset:* — URL or ByteArray
|
|
material:MaterialObject3D (default = null) — The material for the MD2
|
|
fps:int (default = 6) — Frames per second
|
|
scale:Number (default = 1) — Scale
|
| loadCompleteHandler | () | method |
protected function loadCompleteHandler(event:Event):voidParameters
event:Event |
| loadProgressHandler | () | method |
protected function loadProgressHandler(event:ProgressEvent):voidParameters
event:ProgressEvent |
| parse | () | method |
protected function parse(data:ByteArray):void
Parses the MD2 file. This is actually pretty straight forward. Only complicated parts (bit convoluded) are the frame loading and "metaface" loading. Hey, it works, use it =)
Parametersdata:ByteArray — A ByteArray
|
| play | () | method |
public function play(clip:String = null):voidPlays the animation.
Parametersclip:String (default = null) — clip Optional clip name.
|
| project | () | method |
public override function project(parent:DisplayObject3D, renderSessionData:RenderSessionData):NumberProject.
Parametersparent:DisplayObject3D |
|
renderSessionData:RenderSessionData |
Number — Number
|
| readFrames | () | method |
protected function readFrames(data:ByteArray):voidReads in all the frames
Parametersdata:ByteArray |
| readMd2Header | () | method |
protected function readMd2Header(data:ByteArray):voidReads in all that MD2 Header data that is declared as private variables. I know its a lot, and it looks ugly, but only way to do it in Flash
Parametersdata:ByteArray |
| stop | () | method |
public function stop():voidStops the animation.