21 #ifndef VSR_CGA3D_CONTROL_H_INCLUDED
22 #define VSR_CGA3D_CONTROL_H_INCLUDED
26 #include "gfx/gfx_objectController.h"
45 Vec3f ObjectController :: ObjectPtr<A> :: worldPosition(){
47 return Vec3f(p[0],p[1],p[2]);
52 Vec3f ObjectController :: ObjectPtr<Frame> :: worldPosition(){
53 auto p = mAddress->pos();
54 return Vec3f(p[0],p[1],p[2]);
60 void ObjectController :: ObjectPtr<A> :: transform (){
71 Vec3f sc = i->mScene->project(pos);
73 switch(i->io().keyboard.code){
78 Vec3f tm1 = i->io().pos() - sc;
79 Vec3f tm2 = i->io().click() - sc;
82 int neg = (tm1.len() > tm2.len()) ? 1 : -1;
83 float amt = i->io().drag().len() * neg;
92 Vec3f mdc = i->dragCat() * 10;
93 ts = ps.trs( mdc[0], mdc[1], mdc[2] );
98 auto b = i->axisCat();
99 Dll td = pnt <= (
Drv(b[0], b[1], b[2]).dual() );
115 void ObjectController :: ObjectPtr<Frame> :: transform() {
118 Frame& ts = *mAddress;
126 Vec3f sc = i->mScene->project(pos);
129 switch(i->io().keyboard.code){
132 Vec3f tm1 = i->io().pos() - sc;
133 Vec3f tm2 = i->io().click() - sc;
136 int neg = (tm1.len() > tm2.len()) ? 1 : -1;
137 float amt = i->io().drag().len() * neg;
138 ts = ps.dilate( amt );
145 Vec3f mdc = i->dragCat() * 10;
146 ts.pos() = ps.pos().trs( mdc[0], mdc[1], mdc[2] );
151 auto b = i->axisCat();
153 ts.rot() = tr * ps.rot();
159 i->toggleSelect(mAddress);
Common Operations Specific to CGA3D.
NDrv< 5 > Drv
DirectionVector
Definition: vsr_cga3D_types.h:84
NVec< 5 > Vec
Vector
Definition: vsr_cga3D_types.h:62
Definition: vsr_cga2D_draw.h:13
static Rot rot(const Biv &b)
vsr::cga::Rotor from vsr::cga::Bivector
static Point loc(const A &s)
Location (normalizd) of a Round Element (shorthand)
Definition: vsr_cga3D_round.h:146
NDll< 5 > Dll
DualLine
Definition: vsr_cga3D_types.h:79
Pnt Point
Null Vector \(p=\{e_1,e_2,e_3,n_o,n_\infty\}\)
Definition: vsr_cga3D_types.h:128
Generators and Logarithms Optimized for 3D Conformal Geometric Algebra.
Definition: vsr_cga3D_op.h:119
the versor library namespace
Definition: vsr_algebra.h:29
Orthonormal Frame composed from a Position and Orientation.
Definition: vsr_cga3D_frame.h:47
NPnt< 5 > Pnt
Point
Definition: vsr_cga3D_types.h:72
static Tsd dil(const Pnt &p, VSR_PRECISION t)
vsr::cga::Dilator from vsr::cga::Point and amt t
NRot< 5 > Rot
Rotor
Definition: vsr_cga3D_types.h:64