17 #include "Fields/VectorWallFieldSlave.h"
18 #include "Foundation/vec3.h"
19 #include "Foundation/console.h"
42 Vec3 m_origin,m_normal;
48 typedef Vec3 (
CWall::* VectorFieldFunction)()
const;
54 void moveBy(
const Vec3& v)
56 console.
XDebug() <<
"CWall::moveBy: v = " << v <<
"\n";
57 console.
XDebug() <<
"CWall::moveBy: oldpos = " << m_oldpos <<
"\n";
58 console.
XDebug() <<
"CWall::moveBy: pre move origin = " << m_origin <<
"\n";
60 console.
XDebug() <<
"CWall::moveBy: post move origin = " << m_origin <<
"\n";
62 void moveTo(
const Vec3& v){m_origin=v;};
63 void setNormal(
const Vec3& v){m_normal=v;};
64 void setVel(
const Vec3& v){m_vel=v;};
65 Vec3 getVel(){
return m_vel;};
66 inline const Vec3& getOrigin()
const {
return m_origin;};
67 inline const Vec3& getNormal()
const {
return m_normal;};
68 inline void addForce(
const Vec3& force){m_force-=force;};
69 inline void zeroForce(){m_force=
Vec3(0.0,0.0,0.0);};
70 inline const Vec3& getForce(){
return m_force;};
71 inline const Vec3& getPos(){
return m_origin;};
72 Vec3 getPos()
const {
return m_origin;};
73 Vec3 getForce()
const {
return m_force;};
74 inline double getDisplacement(){
return (m_origin-m_oldpos).norm();};
75 inline Vec3 getTotalDisplacement(){
return (m_origin-m_oldpos);};
76 inline void resetDisplacement(){m_oldpos=m_origin;};
85 friend ostream& operator<<(ostream&,
const CWall&);