~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/Physics/Sumo/Fuzzics/include/SM_MotionState.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: SM_MotionState.h,v 1.7 2004/12/04 09:51:04 kester Exp $
 
3
 *
 
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version. The Blender
 
10
 * Foundation also sells licenses for use in proprietary software under
 
11
 * the Blender License.  See http://www.blender.org/BL/ for information
 
12
 * about this.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software Foundation,
 
21
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
22
 *
 
23
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
24
 * All rights reserved.
 
25
 *
 
26
 * The Original Code is: all of this file.
 
27
 *
 
28
 * Contributor(s): none yet.
 
29
 *
 
30
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
 
31
 */
1
32
#ifndef SM_MOTIONSTATE_H
2
33
#define SM_MOTIONSTATE_H
3
34
 
6
37
class SM_MotionState {
7
38
public:
8
39
        SM_MotionState() :
 
40
                m_time(0.0),
9
41
                m_pos(0.0, 0.0, 0.0),
10
42
                m_orn(0.0, 0.0, 0.0, 1.0),
11
43
                m_lin_vel(0.0, 0.0, 0.0),
16
48
        void setOrientation(const MT_Quaternion& orn)      { m_orn = orn; }
17
49
        void setLinearVelocity(const MT_Vector3& lin_vel)  { m_lin_vel = lin_vel; }
18
50
        void setAngularVelocity(const MT_Vector3& ang_vel) { m_ang_vel = ang_vel; }
 
51
        void setTime(MT_Scalar time)                       { m_time = time; }
19
52
        
20
53
        const MT_Point3&     getPosition()        const { return m_pos; }
21
54
        const MT_Quaternion& getOrientation()     const { return m_orn; }
22
55
        const MT_Vector3&    getLinearVelocity()  const { return m_lin_vel; }
23
56
        const MT_Vector3&    getAngularVelocity() const { return m_ang_vel;     }
24
57
        
 
58
        MT_Scalar            getTime()            const { return m_time; }
 
59
        
 
60
        void integrateMidpoint(MT_Scalar timeStep, const SM_MotionState &prev_state, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel);
 
61
        void integrateBackward(MT_Scalar timeStep, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel);
 
62
        void integrateForward(MT_Scalar timeStep, const SM_MotionState &prev_state);
 
63
        
 
64
        void lerp(const SM_MotionState &prev, const SM_MotionState &next);
 
65
        void lerp(MT_Scalar t, const SM_MotionState &other);
 
66
        
25
67
        virtual MT_Transform getTransform() const {
26
68
                return MT_Transform(m_pos, m_orn);
27
69
        }
28
70
 
29
71
protected:
 
72
        MT_Scalar         m_time;
30
73
        MT_Point3         m_pos;
31
74
        MT_Quaternion     m_orn;
32
75
        MT_Vector3        m_lin_vel;