xoreos
0.0.5
|
A 3D model in Nintendo's NSBMD format. More...
#include <model_sonic.h>
Classes | |
struct | Bone |
struct | BoneCommand |
struct | Geometry |
struct | Info |
Info structure, specifies names and offsets of all kinds of lists in Nintendo files. More... | |
struct | Material |
struct | ParserContext |
struct | Polygon |
struct | PolygonCommand |
struct | Primitive |
struct | PrimitiveNode |
Structure to represent a StackMix at run-time. More... | |
struct | PrimitiveVertex |
Intermediate structure to (re)create the VBO/IBO from. More... | |
struct | StackMix |
Structure we use to represent the parameters of a LoadStack bone command. More... | |
Public Member Functions | |
Model_Sonic (const Common::UString &name, ModelType type=kModelTypeObject) | |
~Model_Sonic () | |
void | render (RenderPass pass) |
Render the object. More... | |
Public Member Functions inherited from Graphics::Aurora::Model | |
Model (ModelType type=kModelTypeObject) | |
~Model () | |
void | show () |
Show the object. More... | |
void | hide () |
Hide the object. More... | |
ModelType | getType () const |
Return the model's type. More... | |
const Common::UString & | getName () const |
Get the model's name. More... | |
float | getWidth () const |
Get the width of the model's bounding box. More... | |
float | getHeight () const |
Get the height of the model's bounding box. More... | |
float | getDepth () const |
Get the depth of the model's bounding box. More... | |
void | drawBound (bool enabled) |
Should a bounding box be drawn around this model? More... | |
void | drawSkeleton (bool enabled, bool showInvisible) |
Should a skeleton showing the nodes and their relation be drawn inside the model? More... | |
void | setEnvironmentMap (const Common::UString &environmentMap="") |
Change the environment map on this model. More... | |
void | setSkinned (bool skinned) |
Set the flag if the model has skinned animations. More... | |
bool | isIn (float x, float y) const |
Is that point within the model's bounding box? More... | |
bool | isIn (float x, float y, float z) const |
Is that point within the model's bounding box? More... | |
bool | isIn (float x1, float y1, float z1, float x2, float y2, float z2) const |
Does the line from x1.y1.z1 to x2.y2.z2 intersect with model's bounding box? More... | |
void | getScale (float &x, float &y, float &z) const |
Get the current scale of the model. More... | |
void | getOrientation (float &x, float &y, float &z, float &angle) const |
Get the current orientation of the model. More... | |
void | getPosition (float &x, float &y, float &z) const |
Get the current position of the model. More... | |
void | getAbsolutePosition (float &x, float &y, float &z) const |
Get the position of the node after translate/rotate. More... | |
void | setScale (float x, float y, float z) |
Set the current scale of the model. More... | |
void | setOrientation (float x, float y, float z, float angle) |
Set the current orientation of the model. More... | |
void | setPosition (float x, float y, float z) |
Set the current position of the model. More... | |
void | scale (float x, float y, float z) |
Scale the model, relative to its current scale. More... | |
void | rotate (float x, float y, float z, float angle) |
Rotate the model, relative to its current orientation. More... | |
void | move (float x, float y, float z) |
Move the model, relative to its current position. More... | |
void | getTooltipAnchor (float &x, float &y, float &z) const |
Get the point where the feedback tooltip is anchored. More... | |
const std::list< Common::UString > & | getStates () const |
Return a list of all animation state names. More... | |
void | setState (const Common::UString &name="") |
Set the current animation state. More... | |
const Common::UString & | getState () const |
Return the name of the current state. More... | |
bool | hasNode (const Common::UString &node) const |
Does the specified node exist in the current state? More... | |
ModelNode * | getNode (const Common::UString &node) |
Get the specified node, from the current state. More... | |
const ModelNode * | getNode (const Common::UString &node) const |
Get the specified node, from the current state. More... | |
ModelNode * | getNode (const Common::UString &stateName, const Common::UString &node) |
Get the specified node, from the named state, if it exists. More... | |
const ModelNode * | getNode (const Common::UString &stateName, const Common::UString &node) const |
Get the specified node, from the named state, if it exists. More... | |
ModelNode * | getNode (uint16 nodeNumber) |
Get node by node number. More... | |
const ModelNode * | getNode (uint16 nodeNumber) const |
Get node by node number. More... | |
const std::list< ModelNode * > & | getNodes () |
Get all nodes in the current state. More... | |
void | attachModel (const Common::UString &nodeName, Model *model) |
Add another model as a child to the named node. More... | |
bool | hasAnimation (const Common::UString &anim) const |
Does this model have this named animation? More... | |
float | getAnimationScale (const Common::UString &anim) |
Determine what animation scaling applies. More... | |
void | addAnimationChannel (AnimationChannelName name) |
AnimationChannel * | getAnimationChannel (AnimationChannelName name) |
void | clearDefaultAnimations () |
void | addDefaultAnimation (const Common::UString &anim, uint8 probability) |
void | playDefaultAnimation () |
void | playAnimation (const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f) |
void | calculateDistance () |
Calculate the object's distance. More... | |
void | renderImmediate (const glm::mat4 &parentTransform) |
For shader based systems, don't sort anything, render this right_now. More... | |
void | queueRender (const glm::mat4 &parentTransform) |
Queue the object for later rendering. More... | |
void | advanceTime (float dt) |
Advance time (used by renderables with animations). More... | |
void | flushNodeBuffers () |
Apply buffered changes to model nodes position and geometry. More... | |
Model * | getAttachedModel (const Common::UString &node) |
Public Member Functions inherited from Graphics::GLContainer | |
GLContainer () | |
~GLContainer () | |
void | rebuild () |
void | destroy () |
Public Member Functions inherited from Graphics::Queueable | |
Queueable () | |
virtual | ~Queueable () |
Public Member Functions inherited from Graphics::Renderable | |
Renderable (RenderableType type) | |
~Renderable () | |
bool | operator< (const Queueable &q) const |
double | getDistance () const |
Get the distance of the object from the viewer. More... | |
uint32 | getID () const |
Get the object's unique ID. More... | |
bool | isClickable () const |
Is the object clickable? More... | |
void | setClickable (bool clickable) |
Set the object's clickable state. More... | |
const Common::UString & | getTag () const |
Get the object's tag. More... | |
void | setTag (const Common::UString &tag) |
Set the object's tag. More... | |
bool | isVisible () const |
Is the object visible? More... | |
Static Private Member Functions | |
static double | getFixedPoint (uint32 value, bool sign, uint8 iBits, uint8 fBits) |
Convert the Nintendo DS fixed-point values into floating point doubles. More... | |
static uint8 | getPolygonParameterCount (PolygonCommandID cmd) |
Return the number of parameters required for this geometry command. More... | |
static uint8 | getBoneParameterCount (BoneCommandID cmd, uint8 count) |
Return the number of parameters required for this bone command. More... | |
static glm::mat4 | createPivot (double a, double b, uint8 select, uint8 negate) |
Create a specific pivot matrix. More... | |
Private Attributes | |
Geometries | _geometries |
Friends | |
class | ModelNode_Sonic |
Additional Inherited Members | |
Static Public Member Functions inherited from Graphics::Aurora::Model | |
static void | readValue (Common::SeekableReadStream &stream, uint32 &value) |
static void | readValue (Common::SeekableReadStream &stream, float &value) |
static void | readArrayDef (Common::SeekableReadStream &stream, uint32 &offset, uint32 &count) |
template<typename T > | |
static void | readArray (Common::SeekableReadStream &stream, uint32 offset, uint32 count, std::vector< T > &values) |
Protected Types inherited from Graphics::Aurora::Model | |
typedef std::list< ModelNode * > | NodeList |
typedef std::map< Common::UString, ModelNode *, Common::UString::iless > | NodeMap |
typedef std::map< Common::UString, Animation *, Common::UString::iless > | AnimationMap |
typedef std::map< AnimationChannelName, AnimationChannel * > | AnimationChannelMap |
typedef std::list< State * > | StateList |
typedef std::map< Common::UString, State * > | StateMap |
Protected Member Functions inherited from Graphics::Aurora::Model | |
void | queueDrawBound () |
void | doDrawBound () |
void | doDrawSkeleton () |
Animation * | getAnimation (const Common::UString &anim) |
Get the animation from its name. More... | |
void | finalize () |
Finalize the loading procedure. More... | |
void | doRebuild () |
void | doDestroy () |
Protected Member Functions inherited from Graphics::Queueable | |
bool | isInQueue (QueueType queue) const |
void | addToQueue (QueueType queue) |
void | removeFromQueue (QueueType queue) |
void | lockQueue (QueueType queue) |
void | unlockQueue (QueueType queue) |
void | sortQueue (QueueType queue) |
Protected Member Functions inherited from Graphics::Renderable | |
void | resort () |
void | lockFrame () |
void | unlockFrame () |
void | lockFrameIfVisible () |
void | unlockFrameIfVisible () |
Static Protected Member Functions inherited from Aurora::NitroFile | |
static Common::SeekableSubReadStreamEndian * | open (Common::SeekableReadStream &stream) |
Treat this stream as a Nitro file and return an endian'd stream according to its BOM. More... | |
static Common::SeekableSubReadStreamEndian * | open (Common::SeekableReadStream *stream) |
Treat this stream as a Nitro file, take it over and return an endian'd stream according to its BOM. More... | |
Protected Attributes inherited from Graphics::Aurora::Model | |
ModelType | _type |
The model's type. More... | |
Common::UString | _fileName |
The model's file name. More... | |
Common::UString | _name |
The model's name. More... | |
Common::UString | _superModelName |
Name of the super model. More... | |
Model * | _superModel |
The actual super model. More... | |
StateList | _stateList |
All states within this model. More... | |
StateMap | _stateMap |
All states within this model, index by name. More... | |
State * | _currentState |
The current state. More... | |
std::list< Common::UString > | _stateNames |
All state names. More... | |
AnimationMap | _animationMap |
Map of all animations in this model. More... | |
AnimationChannelMap | _animationChannels |
float | _animationScale |
The scale of the animation. More... | |
float | _scale [3] |
Model's scale. More... | |
float | _orientation [4] |
Model's orientation. More... | |
float | _position [3] |
Model's position. More... | |
float | _center [3] |
Model's center. More... | |
glm::mat4 | _absolutePosition |
Common::BoundingBox | _boundBox |
The model's bounding box. More... | |
Common::BoundingBox | _absoluteBoundBox |
The model's box after translate/rotate. More... | |
bool | _skinned |
bool | _positionRelative |
Shader::ShaderRenderable | _boundRenderable |
glm::mat4 | _boundTransform |
Protected Attributes inherited from Graphics::Renderable | |
QueueType | _queueExists |
QueueType | _queueVisible |
uint32 | _id |
bool | _clickable |
Common::UString | _tag |
double | _distance |
The distance of the object from the viewer. More... | |
A 3D model in Nintendo's NSBMD format.
Conceptually, an NSBMD file consists of these parts:
A bone consists of a name and a transformation that displaces it from its (at that point unknown) parent bone. They are stored as a flat list.
The bone commands specify how the bones connect together, and in which position of the Nintendo's matrix stack the absolute transformation of the bone resides in. The bone commands also pair polygons with materials.
A material has a texture and a palette name, which are references to said names in the NSBTX file with the same name as the model itself. Since we already pair textures with palettes when handling NSBTX files, we don't care about the palette name here. The material also comes with a few properties that are already given in the corresponding NSBTX file. The duplication can probably be ignored; they're hopefully the same. In fact, we don't currently handle these properties at all.
Each polygon references one material, and comes with a list of polygon commands.
The polygon commands produce the actual geometry. They set color, normal and texture coordinates, and generate vertices. They also manipulate the matrix stack, specifically replacing the working matrix with the matrix from the stack position of certain bones. In essence, this bases the vertices on the position of the bone.
(This is only part of the story, though. The bone commands can also set a stack position to the weighted average of several other matrix stack position. We don't (yet) support this and just don't show the affected geometry. Luckily, this is only needed for two models: gup_aa (a robot) and gwr_hf (some kind of giant beetle thing).)
While the Nintendo DS interprets the polygon commands on-the-fly while rendering, and while they can be nearly directly converted to OpenGL-1.2-era glBegin()/glEnd() blocks, this is not really want we want to do. So instead, we, while loading, interpret the polygon commands into an intermediate structure we can use to (re)create IBO/VBO when necessary.
However, the generated geometry is not neatly divisible into model node chunks. Therefore, we generate the node structure only as a semi-fake layer, and the IBO/VBO reside within the Model object, to be regenerated whenever the model nodes change. This also means that operations that would only manipulate a single node, like hiding it, are only possible if the polygon command list takes the possibility into account.
NOTE: Moving/Rotating the model nodes is not actually implemented yet. We probably need a virtual Model::update() method that is called when necessary. Model_Sonic::update() would then reparse the intermediate structure and recreate the IBO/VBO. Better yet, it would only update the vector positions that actually changed.
Definition at line 116 of file model_sonic.h.
|
private |
Definition at line 218 of file model_sonic.h.
|
private |
Definition at line 302 of file model_sonic.h.
|
private |
Definition at line 300 of file model_sonic.h.
|
private |
Definition at line 250 of file model_sonic.h.
|
private |
Definition at line 469 of file model_sonic.h.
|
private |
Definition at line 209 of file model_sonic.h.
|
private |
Definition at line 268 of file model_sonic.h.
|
private |
Definition at line 227 of file model_sonic.h.
|
private |
Definition at line 283 of file model_sonic.h.
|
private |
Definition at line 447 of file model_sonic.h.
|
private |
Definition at line 432 of file model_sonic.h.
|
private |
Definition at line 462 of file model_sonic.h.
|
private |
Definition at line 446 of file model_sonic.h.
|
private |
Definition at line 301 of file model_sonic.h.
|
private |
Definition at line 297 of file model_sonic.h.
|
private |
Definition at line 298 of file model_sonic.h.
|
private |
Definition at line 126 of file model_sonic.h.
|
private |
Definition at line 147 of file model_sonic.h.
|
private |
Enumerator | |
---|---|
kPrimitiveTypeTriangles | |
kPrimitiveTypeQuads | |
kPrimitiveTypeTriangleStrip | |
kPrimitiveTypeQuadStrip |
Definition at line 415 of file model_sonic.h.
Graphics::Aurora::Model_Sonic::Model_Sonic | ( | const Common::UString & | name, |
ModelType | type = kModelTypeObject |
||
) |
Definition at line 107 of file model_sonic.cpp.
References Graphics::Aurora::Model::_fileName, createBound(), Graphics::Aurora::Model::finalize(), and load().
Graphics::Aurora::Model_Sonic::~Model_Sonic | ( | ) |
Definition at line 120 of file model_sonic.cpp.
|
private |
Definition at line 1107 of file model_sonic.cpp.
References Graphics::Aurora::Model::_currentState, Graphics::Aurora::Model::_stateList, Graphics::Aurora::Model::_stateMap, Graphics::Aurora::Model_Sonic::ParserContext::clear(), Graphics::Aurora::Model::State::name, Graphics::Aurora::Model::State::nodeList, Graphics::Aurora::Model::State::nodeMap, Graphics::Aurora::Model_Sonic::ParserContext::nodes, Graphics::Aurora::Model::State::rootNodes, and Graphics::Aurora::Model_Sonic::ParserContext::state.
Referenced by createModelNodes().
|
private |
Definition at line 1061 of file model_sonic.cpp.
References Graphics::Aurora::Model::_absoluteBoundBox, Graphics::Aurora::Model::_absolutePosition, Graphics::Aurora::Model::_boundBox, Graphics::Aurora::Model::_center, _geometries, Common::BoundingBox::absolutize(), Common::BoundingBox::add(), Common::BoundingBox::clear(), Common::BoundingBox::getMax(), Common::BoundingBox::getMin(), Graphics::VertexAttrib::index, Graphics::VertexAttrib::pointer, Graphics::VertexAttrib::size, Graphics::VertexAttrib::stride, Common::BoundingBox::transform(), Graphics::VertexAttrib::type, and Graphics::VPOSITION.
Referenced by Model_Sonic().
|
private |
Definition at line 752 of file model_sonic.cpp.
References _geometries, createIndices(), createPrimitives(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Graphics::Aurora::Model_Sonic::Polygon::material, Graphics::Aurora::Model_Sonic::ParserContext::polygons, Graphics::Aurora::Model_Sonic::Geometry::primitives, Graphics::Aurora::Model_Sonic::Material::texture, Graphics::Aurora::Model_Sonic::Geometry::texture, and TextureMan.
Referenced by load().
|
private |
Definition at line 968 of file model_sonic.cpp.
References createIndicesQuads(), createIndicesQuadStrip(), createIndicesTriangles(), createIndicesTriangleStrip(), kPrimitiveTypeQuads, kPrimitiveTypeQuadStrip, kPrimitiveTypeTriangles, kPrimitiveTypeTriangleStrip, and Graphics::Aurora::Model_Sonic::Primitive::type.
Referenced by createGeometry().
|
private |
Definition at line 1023 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::Primitive::indices, and Graphics::Aurora::Model_Sonic::Primitive::vertices.
Referenced by createIndices().
|
private |
Definition at line 1042 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::Primitive::indices, and Graphics::Aurora::Model_Sonic::Primitive::vertices.
Referenced by createIndices().
|
private |
Definition at line 993 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::Primitive::indices, and Graphics::Aurora::Model_Sonic::Primitive::vertices.
Referenced by createIndices().
|
private |
Definition at line 1002 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::Primitive::indices, and Graphics::Aurora::Model_Sonic::Primitive::vertices.
Referenced by createIndices().
|
private |
Definition at line 717 of file model_sonic.cpp.
References addState(), Graphics::Aurora::Model_Sonic::ParserContext::boneInvisible, Graphics::Aurora::ModelNode_Sonic::createAbsoluteBound(), Graphics::Aurora::ModelNode_Sonic::load(), ModelNode_Sonic, newState(), Graphics::Aurora::Model_Sonic::ParserContext::nodes, Graphics::Aurora::Model_Sonic::ParserContext::rootBones, and Graphics::Aurora::Model_Sonic::ParserContext::stackBones.
Referenced by load().
|
staticprivate |
Create a specific pivot matrix.
Definition at line 1283 of file model_sonic.cpp.
Referenced by readBone().
|
private |
Definition at line 775 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::PrimitiveVertex::color, Graphics::Aurora::Model_Sonic::Polygon::commands, Graphics::Aurora::Model_Sonic::ParserContext::defaultScale, Graphics::Aurora::Model_Sonic::Polygon::defaultStack, Graphics::Aurora::TextureHandle::empty(), Graphics::Aurora::Texture::getHeight(), Graphics::Aurora::TextureHandle::getTexture(), Graphics::Aurora::Texture::getWidth(), Graphics::Aurora::Model_Sonic::Primitive::invalid, kPolygonBeginVertices, kPolygonBoxTest, kPolygonColor, kPolygonDiffuseAmbient, kPolygonEndVertices, kPolygonLightColor, kPolygonLightVector, kPolygonMatrixIdentity, kPolygonMatrixLoad4x3, kPolygonMatrixLoad4x4, kPolygonMatrixMode, kPolygonMatrixMult3x3, kPolygonMatrixMult4x3, kPolygonMatrixMult4x4, kPolygonMatrixPop, kPolygonMatrixPush, kPolygonMatrixRestore, kPolygonMatrixScale, kPolygonMatrixStore, kPolygonMatrixTranslate, kPolygonNOP, kPolygonNormal, kPolygonPaletteBase, kPolygonPolygonAttrib, kPolygonPosTest, kPolygonShininess, kPolygonSpecularEmit, kPolygonSwapBuffers, kPolygonTexCoord, kPolygonTexImageParam, kPolygonVecTest, kPolygonVertex10, kPolygonVertex16, kPolygonVertexDiff, kPolygonVertexXY, kPolygonVertexXZ, kPolygonVertexYZ, kPolygonViewport, Graphics::Aurora::Model_Sonic::PrimitiveVertex::nodes, Graphics::Aurora::Model_Sonic::PrimitiveVertex::normal, Graphics::Aurora::Model_Sonic::Polygon::primitiveCount, Graphics::Aurora::Model_Sonic::Geometry::primitives, Graphics::Aurora::Model_Sonic::Polygon::primitiveSize, readNintendoFixedPoint(), Graphics::Aurora::Model_Sonic::ParserContext::stackBones, Graphics::Aurora::Model_Sonic::ParserContext::stackMix, Graphics::Aurora::Model_Sonic::PrimitiveVertex::texCoord, Graphics::Aurora::Model_Sonic::Geometry::texture, Graphics::Aurora::Model_Sonic::PrimitiveVertex::vertex, and Graphics::Aurora::Model_Sonic::Primitive::vertices.
Referenced by createGeometry().
|
private |
Definition at line 1134 of file model_sonic.cpp.
References _geometries, and evaluatePrimitive().
Referenced by load().
|
private |
Definition at line 1140 of file model_sonic.cpp.
References Graphics::IndexBuffer::getData(), Graphics::VertexBuffer::getData(), Graphics::Aurora::Model_Sonic::Primitive::indexBuffer, Graphics::Aurora::Model_Sonic::Primitive::indices, Graphics::Aurora::Model_Sonic::Primitive::invalid, Graphics::IndexBuffer::setSize(), Graphics::VertexBuffer::setVertexDeclInterleave(), Graphics::VCOLOR, Graphics::Aurora::Model_Sonic::Primitive::vertexBuffer, Graphics::Aurora::Model_Sonic::Primitive::vertices, Graphics::VNORMAL, Graphics::VPOSITION, and Graphics::VTCOORD.
Referenced by evaluateGeometry().
|
private |
Definition at line 687 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::bones, and Graphics::Aurora::Model_Sonic::ParserContext::rootBones.
Referenced by load().
|
private |
Definition at line 699 of file model_sonic.cpp.
References Graphics::Aurora::Model::_name, Graphics::Aurora::Model_Sonic::ParserContext::bones, Common::UString::c_str(), Graphics::Aurora::Model_Sonic::ParserContext::stackBones, and warning().
Referenced by load().
|
private |
Definition at line 738 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::stackBones, and Graphics::Aurora::Model_Sonic::ParserContext::stackMix.
Referenced by load().
|
staticprivate |
Return the number of parameters required for this bone command.
Definition at line 1197 of file model_sonic.cpp.
References kBoneBeginPair, kBoneConnect1, kBoneConnect2, kBoneConnect3, kBoneConnect4, kBoneEnd, kBoneEndPair, kBoneLoadStack, kBoneNOP, kBoneSetInvisible, kBoneSetMaterial1, kBoneSetMaterial2, kBoneSetMaterial3, kBoneSetPolygon, kBoneSetPolygonStack, kBoneUnknown1, kBoneUnknown2, and kBoneUnknown3.
Referenced by readBoneCommands().
|
staticprivate |
Convert the Nintendo DS fixed-point values into floating point doubles.
|
staticprivate |
Return the number of parameters required for this geometry command.
Definition at line 1223 of file model_sonic.cpp.
References kPolygonBeginVertices, kPolygonBoxTest, kPolygonColor, kPolygonDiffuseAmbient, kPolygonEndVertices, kPolygonLightColor, kPolygonLightVector, kPolygonMatrixIdentity, kPolygonMatrixLoad4x3, kPolygonMatrixLoad4x4, kPolygonMatrixMode, kPolygonMatrixMult3x3, kPolygonMatrixMult4x3, kPolygonMatrixMult4x4, kPolygonMatrixPop, kPolygonMatrixPush, kPolygonMatrixRestore, kPolygonMatrixScale, kPolygonMatrixStore, kPolygonMatrixTranslate, kPolygonNOP, kPolygonNormal, kPolygonPaletteBase, kPolygonPolygonAttrib, kPolygonPosTest, kPolygonShininess, kPolygonSpecularEmit, kPolygonSwapBuffers, kPolygonTexCoord, kPolygonTexImageParam, kPolygonVecTest, kPolygonVertex10, kPolygonVertex16, kPolygonVertexDiff, kPolygonVertexXY, kPolygonVertexXZ, kPolygonVertexYZ, and kPolygonViewport.
Referenced by readPolygonCommands().
|
private |
Definition at line 125 of file model_sonic.cpp.
References createGeometry(), createModelNodes(), evaluateGeometry(), findRootBones(), findStackBones(), findStackMixes(), parseBoneCommands(), readHeader(), and readModel().
Referenced by Model_Sonic().
|
private |
Definition at line 1101 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::clear(), and Graphics::Aurora::Model_Sonic::ParserContext::state.
Referenced by createModelNodes().
|
private |
Definition at line 552 of file model_sonic.cpp.
References Graphics::Aurora::Model::_name, Graphics::Aurora::Model_Sonic::ParserContext::boneCommands, Graphics::Aurora::Model_Sonic::ParserContext::boneInvisible, Graphics::Aurora::Model_Sonic::ParserContext::bones, Common::UString::c_str(), Graphics::Aurora::Model_Sonic::Bone::children, kBoneBeginPair, kBoneConnect1, kBoneConnect2, kBoneConnect3, kBoneConnect4, kBoneEnd, kBoneEndPair, kBoneLoadStack, kBoneNOP, kBoneSetInvisible, kBoneSetMaterial1, kBoneSetMaterial2, kBoneSetMaterial3, kBoneSetPolygon, kBoneSetPolygonStack, kBoneUnknown1, kBoneUnknown2, kBoneUnknown3, Graphics::Aurora::Model_Sonic::ParserContext::materials, Graphics::Aurora::Model_Sonic::Bone::nodeID, Graphics::Aurora::Model_Sonic::Bone::nodeStack, Graphics::Aurora::Model_Sonic::Bone::parent, Graphics::Aurora::Model_Sonic::Bone::parentID, Graphics::Aurora::Model_Sonic::Bone::parentStack, Graphics::Aurora::Model_Sonic::ParserContext::polygons, Graphics::Aurora::Model_Sonic::ParserContext::stackMix, and warning().
Referenced by load().
|
private |
Definition at line 303 of file model_sonic.cpp.
References createPivot(), info(), Graphics::Aurora::Model_Sonic::Bone::name, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, readNintendoFixedPoint(), Common::SeekableSubReadStreamEndian::readUint16(), Common::SeekableSubReadStreamEndian::readUint32(), Common::SeekableSubReadStream::seek(), and Graphics::Aurora::Model_Sonic::Bone::transform.
Referenced by readBones().
|
private |
Definition at line 369 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::boneCommands, getBoneParameterCount(), kBoneEnd, kBoneLoadStack, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetBoneCommands, Graphics::Aurora::Model_Sonic::BoneCommand::parameters, Common::SeekableSubReadStream::pos(), Common::ReadStream::readByte(), Common::SeekableSubReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by readModel().
|
private |
Definition at line 292 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::bones, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetBones, readBone(), readInfoOffset(), and Common::SeekableSubReadStream::seek().
Referenced by readModel().
|
private |
Definition at line 237 of file model_sonic.cpp.
References Common::debugTag(), kBMD0ID, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetMDL0, Common::ReadStream::readByte(), Common::SeekableSubReadStreamEndian::readUint16(), Common::SeekableSubReadStreamEndian::readUint32(), Common::ReadStream::readUint32BE(), and Common::SeekableSubReadStream::size().
Referenced by load().
|
private |
Definition at line 185 of file model_sonic.cpp.
References Common::kEncodingASCII, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Common::ReadStream::readByte(), Common::readStringFixed(), Common::SeekableSubReadStreamEndian::readUint32(), Common::SeekableReadStream::skip(), and Common::UString::toLower().
Referenced by readBones(), readMaterialDefinitions(), readModelHeader(), and readPolygons().
|
private |
Definition at line 209 of file model_sonic.cpp.
References Common::kEncodingASCII, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Common::ReadStream::readByte(), Common::readStringFixed(), Common::SeekableSubReadStreamEndian::readUint16(), Common::SeekableReadStream::skip(), and Common::UString::toLower().
Referenced by readMaterialResource().
|
private |
Definition at line 424 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::Material::flipX, Graphics::Aurora::Model_Sonic::Material::flipY, Graphics::Aurora::Model_Sonic::Material::height, info(), Graphics::Aurora::Model_Sonic::Material::name, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Common::SeekableSubReadStreamEndian::readUint16(), Graphics::Aurora::Model_Sonic::Material::scaleX, Graphics::Aurora::Model_Sonic::Material::scaleY, Common::SeekableSubReadStream::seek(), Common::SeekableReadStream::skip(), Graphics::Aurora::Model_Sonic::Material::width, Graphics::Aurora::Model_Sonic::Material::wrapX, and Graphics::Aurora::Model_Sonic::Material::wrapY.
Referenced by readMaterialDefinitions().
|
private |
Definition at line 415 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::materials, Graphics::Aurora::Model_Sonic::ParserContext::offsetMaterials, readInfoOffset(), and readMaterialDefinition().
Referenced by readMaterials().
|
private |
Definition at line 453 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::materials, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetMaterials, Common::ReadStream::readByte(), readInfoOffsetCount(), and Common::SeekableSubReadStream::seek().
Referenced by readMaterials().
|
private |
Definition at line 397 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetMaterials, Graphics::Aurora::Model_Sonic::ParserContext::offsetPalettes, Graphics::Aurora::Model_Sonic::ParserContext::offsetTextures, readMaterialDefinitions(), readMaterialResource(), Common::SeekableSubReadStreamEndian::readUint16(), and Common::SeekableSubReadStream::seek().
Referenced by readModel().
|
private |
Definition at line 148 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::defaultScale, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetBoneCommands, Graphics::Aurora::Model_Sonic::ParserContext::offsetBones, Graphics::Aurora::Model_Sonic::ParserContext::offsetMaterials, Graphics::Aurora::Model_Sonic::ParserContext::offsetModel, Graphics::Aurora::Model_Sonic::ParserContext::offsetPolygons, Common::SeekableSubReadStream::pos(), readBoneCommands(), readBones(), readMaterials(), readModelHeader(), readNintendoFixedPoint(), readPolygons(), Common::SeekableSubReadStreamEndian::readUint32(), Common::SeekableSubReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by load().
|
private |
Definition at line 268 of file model_sonic.cpp.
References Graphics::Aurora::Model::_name, Common::debugTag(), kMDL0ID, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetMDL0, Graphics::Aurora::Model_Sonic::ParserContext::offsetModel, readInfoOffset(), Common::ReadStream::readUint32BE(), Common::SeekableSubReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by readModel().
|
private |
Definition at line 488 of file model_sonic.cpp.
References info(), Graphics::Aurora::Model_Sonic::Polygon::name, Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, readPolygonCommands(), Common::SeekableSubReadStreamEndian::readUint32(), Common::SeekableSubReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by readPolygons().
|
private |
Definition at line 503 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::PolygonCommand::command, Graphics::Aurora::Model_Sonic::Polygon::commands, getPolygonParameterCount(), kPolygonBeginVertices, kPolygonVertex16, kPolygonVertexDiff, MAX(), Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::PolygonCommand::parameters, Graphics::Aurora::Model_Sonic::Polygon::primitiveCount, Graphics::Aurora::Model_Sonic::Polygon::primitiveSize, Common::SubReadStream::read(), and Common::SeekableSubReadStreamEndian::readUint32().
Referenced by readPolygon().
|
private |
Definition at line 477 of file model_sonic.cpp.
References Graphics::Aurora::Model_Sonic::ParserContext::nsbmd, Graphics::Aurora::Model_Sonic::ParserContext::offsetPolygons, Graphics::Aurora::Model_Sonic::ParserContext::polygons, readInfoOffset(), readPolygon(), and Common::SeekableSubReadStream::seek().
Referenced by readModel().
|
virtual |
Render the object.
Reimplemented from Graphics::Aurora::Model.
Definition at line 1336 of file model_sonic.cpp.
References Graphics::Aurora::Model::_currentState, _geometries, Graphics::Aurora::Model::_orientation, Graphics::Aurora::Model::_position, Graphics::Aurora::Model::_scale, Graphics::Aurora::Model::doDrawBound(), Graphics::Aurora::Model::doDrawSkeleton(), Graphics::kRenderPassAll, Graphics::kRenderPassOpaque, Graphics::kRenderPassTransparent, pass, and TextureMan.
|
friend |
Definition at line 476 of file model_sonic.h.
Referenced by createModelNodes().
|
private |
Definition at line 471 of file model_sonic.h.
Referenced by createBound(), createGeometry(), evaluateGeometry(), and render().