CC3PODCamera Class Reference
Inherits from | CC3Camera : CC3Node : CC3Identifiable : NSObject |
Declared in | CC3PODCamera.h CC3PODCamera.mm |
Overview
A CC3Camera whose content originates from POD resource data.
This is a concrete implementation of the CC3Node category PVRPOD.
In this implementation, the fieldOfViewOrientation is set to CC3FieldOfViewOrientationHorizontal since the fieldOfView value in a POD file is always specified as the horizontal field of view.
Tasks
-
– podIndex
-
– setPodIndex:
-
– podContentIndex
-
– setPodContentIndex:
-
– podParentIndex
-
– setPodParentIndex:
-
– podTargetIndex
-
– setPodTargetIndex:
-
– initAtIndex:fromPODResource:
-
– nodePODStructAtIndex:fromPODResource:
-
– clearScaleContentIn:
-
– adjustQuaternionsIn:withAnimationFrameCount:
-
– populateFrom:
-
– description
Instance Methods
adjustQuaternionsIn:withAnimationFrameCount:
Cameras in Cocos3D are oriented to the OpenGL standard of pointing down the -Z axis, with the UP direction pointing up the +Y axis. However, the camera is a POD file is oriented so that it points down the -Y axis, with the up direction pointing down the -Z axis.
- (void)adjustQuaternionsIn:(SPODNode *)psn withAnimationFrameCount:(GLuint)numFrames
Discussion
The POD orientation can be aligned with the OpenGL orientation by rotating the camera -90 degrees around the +X axis.
This method runs through the quaternions in the rotation animation array (including the initial rotation setting in the first element, even if rotation animation is not used), and prepreds a fixed -90 degrees rotation around the X-axis to each quaternion. This is done by creating a -90 degree +X axis rotation quaternion, multiplying it by each of the quaternions in the rotation animation array, and placing eac of the results back in the rotation animation array.
Declared In
CC3PODCamera.mm
clearScaleContentIn:
In Cocos3D, scaling a camera affects the effective field of view. In a POD file, scale info is meaningless and should be ignored. This is handled here by clearing the scale animation flag, and clearing the scale animation content before building the camera node.
- (void)clearScaleContentIn:(SPODNode *)psn
Declared In
CC3PODCamera.mm
initAtIndex:fromPODResource:
Initializes this instance from the data of this type at the specified index within the specified POD resource.
- (id)initAtIndex:(GLint)aPODIndex fromPODResource:(CC3PODResource *)aPODRez
Declared In
CC3IdentifiablePODExtensions.h
nodePODStructAtIndex:fromPODResource:
Returns the underlying SPODNode data structure from the specified resource, for the SPODNode at the specified index.
- (PODStructPtr)nodePODStructAtIndex:(uint)aPODIndex fromPODResource:(CC3PODResource *)aPODRez
Discussion
The returned pointer must be cast to SPODNode before accessing any internals of the data structure.
Declared In
CC3NodePODExtensions.h
podContentIndex
The index of the POD data that forms the type-specific content of this node.
- (GLint)podContentIndex
Discussion
This is distinct from the podIndex property, which is the index of the data for the node, which may be of any node type. Once the type is established, the type-specific content is indexed by the podContentIndex property.
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h
podIndex
The index of this object in the POD resource data. This generally means the podIndex'th type of object of the class.
- (GLint)podIndex
Declared In
CC3IdentifiablePODExtensions.h
podParentIndex
The index of the parent node of this node. This will be -1 if this node has no parent.
- (GLint)podParentIndex
Discussion
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h
podTargetIndex
The index of the node that is the target of this node. This node will be linked to its target in the linkToPODNodes: method.
- (GLint)podTargetIndex
Discussion
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h
populateFrom:
Template method that populates this instance from the specified other instance.
- (void)populateFrom:(CC3PODCamera *)another
Discussion
This method is invoked automatically during object copying via the copy or copyWithZone: method. In most situations, the application should use the copy method, and should never need to invoke this method directly.
Subclasses that add additional instance state (instance variables) should extend copying by overriding this method to copy that additional state. Superclass that override this method should be sure to invoke the superclass implementation to ensure that superclass state is copied as well.
Declared In
CC3Identifiable.h
setPodContentIndex:
The index of the POD data that forms the type-specific content of this node.
- (void)setPodContentIndex:(GLint)aPODIndex
Discussion
This is distinct from the podIndex property, which is the index of the data for the node, which may be of any node type. Once the type is established, the type-specific content is indexed by the podContentIndex property.
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h
setPodIndex:
The index of this object in the POD resource data. This generally means the podIndex'th type of object of the class.
- (void)setPodIndex:(GLint)aPODIndex
Declared In
CC3IdentifiablePODExtensions.h
setPodParentIndex:
The index of the parent node of this node. This will be -1 if this node has no parent.
- (void)setPodParentIndex:(GLint)aPODIndex
Discussion
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h
setPodTargetIndex:
The index of the node that is the target of this node. This node will be linked to its target in the linkToPODNodes: method.
- (void)setPodTargetIndex:(GLint)aPODIndex
Discussion
This abstract implementation does not map this property to an instance variable, and always returns kCC3PODNilIndex. Concrete subclasses must override to map to an actual instance variable.
Declared In
CC3NodePODExtensions.h