Changeset 405 for cafu/trunk

Show
Ignore:
Timestamp:
10/11/11 10:39:53 (7 months ago)
Author:
Carsten
Message:

Model support:
A temporary change to better support the old ModelT interface, just until it is removed in favor of the newer CafuModelT and AnimPoseT methods.

Location:
cafu/trunk/Libs/Models
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/Models/Model_cmdl.cpp

    r400 r405  
    2121 
    2222#include "Model_cmdl.hpp" 
    23 #include "AnimPose.hpp"     // Only for implementing the "old" ModelT interface methods. 
    2423#include "Loader.hpp" 
    2524#include "MaterialSystem/Material.hpp" 
     
    236235 
    237236 
     237// TEMPORARY! 
     238#if defined(_WIN32) && defined(_MSC_VER) 
     239// Turn off "warning C4355: 'this' : used in base member initializer list". 
     240#pragma warning(disable:4355) 
     241#endif 
     242 
     243 
    238244CafuModelT::CafuModelT(ModelLoaderT& Loader) 
    239245    : m_FileName(Loader.GetFileName()), 
     
    241247      m_UseGivenTangentSpace(Loader.UseGivenTS()),  // Should we use the fixed, given tangent space, or recompute it ourselves here? 
    242248      m_BindPoseBB(Vector3fT())                     // Re-initialized in InitMeshes() calling RecomputeBindPoseBB(), but start with a valid box anyways (e.g. for testing models that have a skeleton, but no mesh). 
     249      , m_TEMP_Pose(*this) 
    243250{ 
    244251    // No matter the actual model file format (that is, even if the file format is not "cmdl"), 
     
    954961void CafuModelT::Draw(int SequenceNr, float FrameNr, float LodDist, const ModelT* /*SubModel*/) const 
    955962{ 
    956     AnimPoseT Pose(*this, SequenceNr, FrameNr);     // TODO: This is reconstructed on each call -- no caching at all! 
    957  
    958     Pose.Draw(-1 /*default skin*/, LodDist); 
     963    m_TEMP_Pose.SetSequNr(SequenceNr); 
     964    m_TEMP_Pose.SetFrameNr(FrameNr); 
     965 
     966    m_TEMP_Pose.Draw(-1 /*default skin*/, LodDist); 
    959967} 
    960968 
     
    10331041bool CafuModelT::TraceRay(int SequenceNr, float FrameNr, int SkinNr, const Vector3fT& RayOrigin, const Vector3fT& RayDir, TraceResultT& Result) const 
    10341042{ 
    1035     AnimPoseT Pose(*this, SequenceNr, FrameNr);     // TODO: This is reconstructed on each call -- no caching at all! 
    1036  
    1037     return Pose.TraceRay(SkinNr, RayOrigin, RayDir, Result); 
     1043    m_TEMP_Pose.SetSequNr(SequenceNr); 
     1044    m_TEMP_Pose.SetFrameNr(FrameNr); 
     1045 
     1046    return m_TEMP_Pose.TraceRay(SkinNr, RayOrigin, RayDir, Result); 
    10381047} 
    10391048 
  • cafu/trunk/Libs/Models/Model_cmdl.hpp

    r400 r405  
    2828#include "Math3D/BoundingBox.hpp" 
    2929#include "Math3D/Matrix.hpp" 
     30#include "AnimPose.hpp"     // Only for TEMPORARILY implementing the "old" ModelT interface methods. 
    3031#include "Model.hpp" 
    3132 
     
    314315 // const bool            m_CastShadows;            ///< Should this model cast shadows? 
    315316    BoundingBox3fT        m_BindPoseBB;             ///< [REMOVE???] The bounding-box for the base pose of the model. 
     317 
     318    mutable AnimPoseT m_TEMP_Pose;      ///< TEMPORARY! 
    316319}; 
    317320