00001 00002 // 00003 // Copyright (C) 2006 James M. Lawrence. All rights reserved. 00004 // 00005 // software: esve-1.0.3 00006 // file: esve/components/dim4/Motion_Frame.hxx 00007 // 00008 // Redistribution and use in source and binary forms, with or without 00009 // modification, are permitted provided that the following conditions 00010 // are met: 00011 // 00012 // 1. Redistributions of source code must retain the above copyright 00013 // notice, this list of conditions and the following disclaimer. 00014 // 00015 // 2. The origin of this software must not be misrepresented; you must 00016 // not claim that you wrote the original software. If you use this 00017 // software in a product, an acknowledgment in the product 00018 // documentation would be appreciated but is not required. 00019 // 00020 // 3. Altered source versions must be plainly marked as such, and must 00021 // not be misrepresented as being the original software. 00022 // 00023 // 4. The name of the author may not be used to endorse or promote 00024 // products derived from this software without specific prior written 00025 // permission. 00026 // 00027 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY, 00028 // AND WITH NO CLAIM AS TO ITS SUITABILITY FOR ANY PURPOSE. IN NO EVENT 00029 // SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM WHATSOEVER MADE IN CONNECTION 00030 // TO THIS SOFTWARE. 00031 // 00033 // 00034 // frames which move on each update() 00035 // 00036 00037 #ifndef esve_components_dim4_Motion_Frame_hxx 00038 #define esve_components_dim4_Motion_Frame_hxx 00039 00040 #include <esve/components/dimn/Motion_Handler.hxx> 00041 #include <esve/engine/dim4/impl/Frame.hxx> 00042 #include <esve/engine/dim4/Transform.hxx> 00043 #include <esve/types/quat.hxx> 00044 00045 namespace esve { namespace components { namespace dim4 { 00046 00051 00052 class Motion_Frame 00053 : public components::dimn::Motion_Handler, 00054 public engine::dim4::impl::Frame 00055 { 00056 public: 00057 Motion_Frame() ; 00058 00059 // 00060 // see base::dim4::Transform for more info 00061 // 00062 00065 void rotate_velocity( types::real dalpha_dt, 00066 types::real dbeta_dt, 00067 const types::quat & a, 00068 const types::quat & b, 00069 const engine::dim4::Transform & basis = 00070 engine::dim4::Transform::IDENTITY ) ; 00071 00073 void translate_velocity( const types::quat & dtranslate_dt, 00074 const engine::dim4::Transform & basis = 00075 engine::dim4::Transform::IDENTITY ) ; 00076 00078 void invertate_velocity( const types::quat & dinvertate_dt, 00079 const engine::dim4::Transform & basis = 00080 engine::dim4::Transform::IDENTITY ) ; 00081 00083 void scalate_velocity( types::real dscalate_dt, 00084 const engine::dim4::Transform & basis = 00085 engine::dim4::Transform::IDENTITY ) ; 00086 00087 ~Motion_Frame() ; 00088 00089 protected: 00090 bool handle_check_awake( bool currently_awake ) ; 00091 00092 void update() ; 00093 void update( double dt ) ; 00094 00095 private: 00096 Motion_Frame( const Motion_Frame & ) ; 00097 Motion_Frame & operator=( const Motion_Frame & ) ; 00098 00099 types::quat m_dtranslate_dt ; 00100 types::quat m_dinvertate_dt ; 00101 types::real m_dscalate_dt ; 00102 types::real m_dalpha_dt ; 00103 types::real m_dbeta_dt ; 00104 types::quat m_plane_vector0 ; 00105 types::quat m_plane_vector1 ; 00106 00107 const engine::dim4::Transform* m_translate_basis ; 00108 const engine::dim4::Transform* m_invertate_basis ; 00109 const engine::dim4::Transform* m_scalate_basis ; 00110 const engine::dim4::Transform* m_rotate_basis ; 00111 } ; 00112 00113 }}} // namespace esve::components::dim4 00114 00115 #endif 00116
1.3.4