KiCad PCB EDA Suite
nl_3d_viewer_plugin_impl.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 3Dconnexion
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22
23// 3d-viewer
26
27// KiCAD includes
28#include <tool/action_manager.h>
29#include <tool/tool_manager.h>
30
31// stdlib
32#include <map>
33#include <string>
34#include <vector>
35
36#include <wx/mstream.h>
37
45const wxChar* NL_3D_VIEWER_PLUGIN_IMPL::m_logTrace = wxT( "KI_TRACE_NL_3D_VIEWER_PLUGIN" );
46
47
56template <glm::length_t L, glm::length_t C, class T, glm::qualifier Q>
57bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSecond,
58 T aEpsilon = static_cast<T>( FLT_EPSILON * 10 ) )
59{
60 T const* first = glm::value_ptr( aFirst );
61 T const* second = glm::value_ptr( aSecond );
62
63 for( glm::length_t j = 0; j < L * C; ++j )
64 {
65 if( !equals( first[j], second[j], aEpsilon ) )
66 {
67 return false;
68 }
69 }
70
71 return true;
72}
73
74
76 NAV_3D( false, false ), m_canvas( aCanvas ), m_capIsMoving( false )
77{
78 m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
79
80 PutProfileHint( "KiCAD 3D" );
81
82 EnableNavigation( true );
83 PutFrameTimingSource( TimingSource::SpaceMouse );
84
86}
87
88
90{
91 EnableNavigation( false );
92}
93
94
96{
97 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::SetFocus %d" ), aFocus );
98 NAV_3D::Write( navlib::focus_k, aFocus );
99}
100
101// temporary store for the categories
102typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
103
113CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore )
114{
115 using TDx::SpaceMouse::CCategory;
116
117 CATEGORY_STORE::iterator parent_iter = aCategoryStore.begin();
118 std::string::size_type pos = aCategoryPath.find_last_of( '.' );
119
120 if( pos != std::string::npos )
121 {
122 std::string parentPath = aCategoryPath.substr( 0, pos );
123 parent_iter = aCategoryStore.find( parentPath );
124
125 if( parent_iter == aCategoryStore.end() )
126 {
127 parent_iter = add_category( parentPath, aCategoryStore );
128 }
129 }
130
131 std::string name = aCategoryPath.substr( pos + 1 );
132 std::unique_ptr<CCategory> categoryNode =
133 std::make_unique<CCategory>( aCategoryPath.c_str(), name.c_str() );
134
135 CATEGORY_STORE::iterator iter = aCategoryStore.insert(
136 aCategoryStore.end(), CATEGORY_STORE::value_type( aCategoryPath, categoryNode.get() ) );
137
138 parent_iter->second->push_back( std::move( categoryNode ) );
139 return iter;
140}
141
142
144{
145 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages" ) );
146
147 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
148
149 if( actions.size() == 0 )
150 {
151 return;
152 }
153
154 using TDx::SpaceMouse::CCommand;
155 using TDx::SpaceMouse::CCommandSet;
156
157 // The root action set node
158 CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
159
160 // Activate the command set
161 NAV_3D::PutActiveCommands( commandSet.GetId() );
162
163 // temporary store for the categories
164 CATEGORY_STORE categoryStore;
165
166 std::vector<TDx::CImage> vImages;
167
168 // add the action set to the category_store
169 categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
170
171 std::list<TOOL_ACTION*>::const_iterator it;
172
173 for( it = actions.begin(); it != actions.end(); ++it )
174 {
175 const TOOL_ACTION* action = *it;
176 std::string label = action->GetLabel().ToStdString();
177
178 if( label.empty() )
179 {
180 continue;
181 }
182
183 std::string name = action->GetName();
184
185 // Do no export commands for the pcbnew app.
186 if( name.rfind( "pcbnew.", 0 ) == 0 )
187 {
188 continue;
189 }
190
191 std::string strCategory = action->GetToolName();
192 CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
193
194 if( iter == categoryStore.end() )
195 {
196 iter = add_category( std::move( strCategory ), categoryStore );
197 }
198
199 std::string description = action->GetDescription().ToStdString();
200
201 // Arbitrary 8-bit data stream
202 wxMemoryOutputStream imageStream;
203
204 if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
205 {
206 wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
207 image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
208 image.Destroy();
209
210 if( imageStream.GetSize() )
211 {
212 wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
213 TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
214 tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
215 streamBuffer->GetBufferStart() ),
216 streamBuffer->GetBufferSize() ),
217 0 );
218
219 wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
220 vImages.push_back( std::move( tdxImage ) );
221 }
222 }
223
224 wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
225 name, description, iter->first );
226
227 iter->second->push_back(
228 CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
229 }
230
231 NAV_3D::AddCommandSet( commandSet );
232 NAV_3D::AddImages( vImages );
233}
234
235
236long NL_3D_VIEWER_PLUGIN_IMPL::GetCameraMatrix( navlib::matrix_t& matrix ) const
237{
238 // cache the camera matrix so that we can tell if the view has been moved and
239 // calculate a delta transform if required.
241
242 std::copy_n( glm::value_ptr( glm::inverse( m_cameraMatrix ) ), 16, matrix.m );
243
244 return 0;
245}
246
247
248long NL_3D_VIEWER_PLUGIN_IMPL::GetPointerPosition( navlib::point_t& position ) const
249{
250 SFVEC3F origin, direction;
251 m_camera->MakeRayAtCurrentMousePosition( origin, direction );
252
253 position = { origin.x, origin.y, origin.z };
254
255 return 0;
256}
257
258
259long NL_3D_VIEWER_PLUGIN_IMPL::GetViewExtents( navlib::box_t& extents ) const
260{
262 {
263 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
264 }
265
266 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
267
268 double half_width = f.fw / 2.;
269 double half_height = f.fh / 2.;
270 extents = { -half_width, -half_height, f.nearD, half_width, half_height, f.farD };
271
272 return 0;
273}
274
275
276long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFOV( double& aFov ) const
277{
278 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
279
280 aFov = glm::radians( f.angle );
281 return 0;
282}
283
284
285long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFrustum( navlib::frustum_t& aFrustum ) const
286{
288 {
289 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
290 }
291
292 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
293 double half_width = f.nw / 2.;
294 double half_height = f.nh / 2.;
295 aFrustum = { -half_width, half_width, -half_height, half_height, f.nearD, f.farD };
296
297 return 0;
298}
299
300
301long NL_3D_VIEWER_PLUGIN_IMPL::GetIsViewPerspective( navlib::bool_t& perspective ) const
302{
303 perspective = m_camera->GetProjection() == PROJECTION_TYPE::PERSPECTIVE ? 1 : 0;
304
305 return 0;
306}
307
308
309long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraMatrix( const navlib::matrix_t& aCameraMatrix )
310{
311 long result = 0;
312
313 glm::mat4 cam, viewMatrix;
314 std::copy_n( aCameraMatrix.m, 16, glm::value_ptr( cam ) );
315 viewMatrix = glm::inverse( cam );
316
317 glm::mat4 camera = m_camera->GetViewMatrix();
318
319 // The navlib does not move the camera in its z-axis in an orthographic projection
320 // as this does not change the viewed object size. However ...
321
323 {
324 // ... the CAMERA class couples zoom and distance to the object: we need to
325 // ensure that The CAMERA's z position relative to the lookat_pos is not changed
326 // in an orthographic projection.
327 glm::vec4 lookat( m_camera->GetLookAtPos(), 1.0f );
328 glm::vec4 lookat_new = viewMatrix * lookat;
329 glm::vec4 lookat_old = camera * lookat;
330
331 viewMatrix[3].z += lookat_old.z - lookat_new.z;
332 }
333
334 if( !equals( camera, m_cameraMatrix ) )
335 {
336 // Some other input device has moved the camera. Apply only the intended delta
337 // transform ...
338 m_camera->SetViewMatrix( viewMatrix * glm::inverse( m_cameraMatrix ) * camera );
339 m_camera->Update();
340
341 // .., cache the intended camera matrix so that we can calculate the delta
342 // transform when needed ...
343 m_cameraMatrix = viewMatrix;
344
345 // ... and let the 3DMouse controller know, that something is amiss.
346 return navlib::make_result_code( navlib::navlib_errc::error );
347 }
348
349 m_camera->SetViewMatrix( viewMatrix );
350 m_camera->Update();
351
352 // cache the view matrix so that we know when it has changed.
354
355 // The camera has a constraint on the z position so we need to check that ...
356
357 if( !equals( m_cameraMatrix[3].z, viewMatrix[3].z ) )
358 {
359 // ... and let the 3DMouse controller know, when something is amiss.
360 return navlib::make_result_code( navlib::navlib_errc::error );
361 }
362
363 return 0;
364}
365
366
367long NL_3D_VIEWER_PLUGIN_IMPL::SetViewExtents( const navlib::box_t& extents )
368{
369 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
370
371 float factor = f.nw / ( extents.max_x - extents.min_x );
372 float zoom = m_camera->GetZoom() / factor;
373
374 m_camera->Zoom( factor );
375
376 // The camera auto positions the camera to match the zoom values. We need to
377 // update our cached camera matrix to match the new z value
379
380 // The camera has a constraint on the zoom factor so we need to check that ...
381 if( zoom != m_camera->GetZoom() )
382 {
383 // ... and let the 3DMouse controller know, when something is amiss.
384 return navlib::make_result_code( navlib::navlib_errc::error );
385 }
386
387 return 0;
388}
389
390
392{
393 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
394}
395
396
397long NL_3D_VIEWER_PLUGIN_IMPL::SetViewFrustum( const navlib::frustum_t& frustum )
398{
399 return navlib::make_result_code( navlib::navlib_errc::permission_denied );
400}
401
402
403long NL_3D_VIEWER_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
404{
407
408 extents = { min.x, min.y, min.z, max.x, max.y, max.z };
409
410 return 0;
411}
412
413
414long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionExtents( navlib::box_t& extents ) const
415{
416 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
417}
418
419
420long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionTransform( navlib::matrix_t& transform ) const
421{
422 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
423}
424
425
427{
428 empty = true;
429
430 return 0;
431}
432
433
434long NL_3D_VIEWER_PLUGIN_IMPL::SetSelectionTransform( const navlib::matrix_t& matrix )
435{
436 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
437}
438
439
440long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotPosition( navlib::point_t& position ) const
441{
443
444 position = { lap.x, lap.y, lap.z };
445
446 return 0;
447}
448
449
450long NL_3D_VIEWER_PLUGIN_IMPL::IsUserPivot( navlib::bool_t& userPivot ) const
451{
452 userPivot = false;
453
454 return 0;
455}
456
457
458long NL_3D_VIEWER_PLUGIN_IMPL::SetPivotPosition( const navlib::point_t& position )
459{
460 SFVEC3F pivotPos = SFVEC3F( position.x, position.y, position.z );
461
462 // Set the 3dmouse pivot position.
463 m_canvas->Set3dmousePivotPos( pivotPos );
464
465 // Set the camera lookat pos.
466 m_camera->SetLookAtPos_T1( pivotPos );
467
469
470 return 0;
471}
472
473
474long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotVisible( navlib::bool_t& visible ) const
475{
476 visible = m_canvas->GetRender3dmousePivot();
477
478 return 0;
479}
480
481
483{
484 m_canvas->SetRender3dmousePivot( visible );
485
487
488 return 0;
489}
490
491
492long NL_3D_VIEWER_PLUGIN_IMPL::GetHitLookAt( navlib::point_t& position ) const
493{
494 RAY mouseRay;
495 mouseRay.Init( m_rayOrigin, m_rayDirection );
496
497 float hit;
498 glm::vec3 vec;
499
500 // Test it with the board bounding box
501
502 if( m_canvas->GetBoardAdapter().GetBBox().Intersect( mouseRay, &hit ) )
503 {
504 vec = mouseRay.at( hit );
505 position = { vec.x, vec.y, vec.z };
506 return 0;
507 }
508
509 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
510}
511
512
514{
515 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
516}
517
518
519long NL_3D_VIEWER_PLUGIN_IMPL::SetHitDirection( const navlib::vector_t& direction )
520{
521 m_rayDirection = { direction.x, direction.y, direction.z };
522
523 return 0;
524}
525
526
527long NL_3D_VIEWER_PLUGIN_IMPL::SetHitLookFrom( const navlib::point_t& eye )
528{
529 m_rayOrigin = { eye.x, eye.y, eye.z };
530
531 return 0;
532}
533
534
536{
537 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
538}
539
540
542{
543 if( commandId.empty() )
544 {
545 return 0;
546 }
547
548 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
549 TOOL_ACTION* context = nullptr;
550
551 for( std::list<TOOL_ACTION*>::const_iterator it = actions.begin(); it != actions.end(); it++ )
552 {
553 TOOL_ACTION* action = *it;
554 std::string nm = action->GetName();
555
556 if( commandId == nm )
557 {
558 context = action;
559 }
560 }
561
562 if( context != nullptr )
563 {
564 wxWindow* parent = m_canvas->GetParent();
565
566 // Only allow command execution if the window is enabled. i.e. there is not a modal dialog
567 // currently active.
568
569 if( parent->IsEnabled() )
570 {
571 TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
572
573 if( tool_manager == nullptr )
574 {
575 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
576 }
577
578 // Get the selection to use to test if the action is enabled
579 SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
580
581 bool runAction = true;
582
583 if( const ACTION_CONDITIONS* aCond =
584 tool_manager->GetActionManager()->GetCondition( *context ) )
585 {
586 runAction = aCond->enableCondition( sel );
587 }
588
589 if( runAction )
590 {
591 tool_manager->RunAction( *context, true );
593 }
594 }
595 else
596 {
597 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
598 }
599 }
600
601 return 0;
602}
603
604
606{
607 return 0;
608}
609
610
612{
613 m_capIsMoving = value;
614
615 return 0;
616}
617
618
620{
621 if( value != 0L )
622 {
623 }
624 else
625 {
626 m_canvas->Request_refresh( true );
627 wxLogTrace( m_logTrace, wxT( "End of transaction" ) );
628 }
629
630 return 0;
631}
632
633
634long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraTarget( const navlib::point_t& position )
635{
636 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
637}
638
639
640long NL_3D_VIEWER_PLUGIN_IMPL::GetFrontView( navlib::matrix_t& matrix ) const
641{
642 matrix = { 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 };
643 return 0;
644}
645
646
647long NL_3D_VIEWER_PLUGIN_IMPL::GetCoordinateSystem( navlib::matrix_t& matrix ) const
648{
649 // Use the right-handed coordinate system X-right, Z-up, Y-in (row vectors)
650 matrix = { 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1 };
651 return 0;
652}
653
654
655long NL_3D_VIEWER_PLUGIN_IMPL::GetIsViewRotatable( navlib::bool_t& isRotatable ) const
656{
657 isRotatable = true;
658 return 0;
659}
const char * name
Definition: DXF_plotter.cpp:56
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
@ INVALID_BITMAP
const ACTION_CONDITIONS * GetCondition(const TOOL_ACTION &aAction) const
Get the conditions to use for a specific tool action.
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
const BBOX_3D & GetBBox() const noexcept
Get the board outling bounding box.
const CAMERA_FRUSTUM & GetFrustum() const
Definition: camera.h:114
bool Zoom(float aFactor)
Definition: camera.cpp:538
PROJECTION_TYPE GetProjection()
Definition: camera.h:179
float GetZoom() const
Definition: camera.h:195
const SFVEC3F & GetLookAtPos() const
Definition: camera.h:115
void MakeRayAtCurrentMousePosition(SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on the latest mouse position.
Definition: camera.cpp:402
const glm::mat4 & GetViewMatrix() const
Definition: camera.cpp:450
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
Definition: camera.h:136
void SetViewMatrix(glm::mat4 aViewMatrix)
Set the affine matrix to be applied to a transformation camera.
Definition: camera.cpp:456
void Update()
Update the camera.
Definition: camera.h:276
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:49
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
const BOARD_ADAPTER & GetBoardAdapter() const
Get information used to display 3D board.
CAMERA * GetCamera()
Get the canvas camera.
long GetViewExtents(navlib::box_t &aExtents) const override
long GetCameraMatrix(navlib::matrix_t &aMatrix) const override
long SetHitLookFrom(const navlib::point_t &aPosition) override
long SetActiveCommand(std::string aCommandId) override
long GetPivotPosition(navlib::point_t &aPosition) const override
long GetModelExtents(navlib::box_t &aExtents) const override
long GetPointerPosition(navlib::point_t &aPosition) const override
long SetPivotVisible(bool aVisible) override
long SetTransaction(long aValue) override
long SetViewFOV(double aFov) override
long SetMotionFlag(bool aValue) override
long SetCameraMatrix(const navlib::matrix_t &aMatrix) override
long GetHitLookAt(navlib::point_t &aPosition) const override
long SetHitAperture(double aAperture) override
long SetPivotPosition(const navlib::point_t &aPosition) override
long SetHitDirection(const navlib::vector_t &aDirection) override
long GetSelectionTransform(navlib::matrix_t &aTransform) const override
long SetSelectionTransform(const navlib::matrix_t &aMatrix) override
long SetSettingsChanged(long aChangeNumber) override
long SetHitSelectionOnly(bool aSelectionOnly) override
long GetIsSelectionEmpty(navlib::bool_t &aEmpty) const override
NL_3D_VIEWER_PLUGIN_IMPL(EDA_3D_CANVAS *aCanvas)
Initializes a new instance of the NL_3DVIEWER_PLUGIN.
long GetSelectionExtents(navlib::box_t &aExtents) const override
long GetCoordinateSystem(navlib::matrix_t &aMatrix) const override
long IsUserPivot(navlib::bool_t &aUserPivot) const override
long GetViewFOV(double &aFov) const override
long GetPivotVisible(navlib::bool_t &aVisible) const override
long GetFrontView(navlib::matrix_t &aMatrix) const override
long GetViewFrustum(navlib::frustum_t &aFrustum) const override
long GetIsViewPerspective(navlib::bool_t &aPerspective) const override
long SetViewFrustum(const navlib::frustum_t &aFrustum) override
long SetViewExtents(const navlib::box_t &aExtents) override
void exportCommandsAndImages()
Export the invocable actions and images to the 3Dconnexion UI.
void SetFocus(bool aFocus=true)
Set the connection to the 3Dconnexion driver to the focus state so that 3DMouse data is routed here.
long GetIsViewRotatable(navlib::bool_t &isRotatable) const override
long SetCameraTarget(const navlib::point_t &aPosition) override
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual SELECTION & GetCurrentSelection()
Get the current selection from the canvas area.
Definition: tools_holder.h:101
Represent a single user action.
Definition: tool_action.h:68
wxString GetLabel() const
Definition: tool_action.cpp:83
std::string GetToolName() const
Return name of the tool associated with the action.
const BITMAPS GetIcon() const
Return an icon associated with the action.
Definition: tool_action.h:192
wxString GetDescription(bool aIncludeHotkey=true) const
Definition: tool_action.cpp:97
const std::string & GetName() const
Return name of the action.
Definition: tool_action.h:101
Master controller class:
Definition: tool_manager.h:55
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:142
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:296
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:196
static bool empty(const wxTextEntryBase *aCtrl)
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool equals(glm::mat< L, C, T, Q > const &aFirst, glm::mat< L, C, T, Q > const &aSecond, T aEpsilon=static_cast< T >(FLT_EPSILON *10))
Template to compare two glm::mat<T> values for equality within a required epsilon.
std::map< std::string, TDx::CCommandTreeNode * > CATEGORY_STORE
CATEGORY_STORE::iterator add_category(std::string aCategoryPath, CATEGORY_STORE &aCategoryStore)
Add a category to the store.
Declaration of the NL_3D_VIEWER_PLUGIN_IMPL class.
TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
bool Intersect(const RAY &aRay, float *t) const
Definition: bbox_3d_ray.cpp:46
const SFVEC3F & Min() const
Return the minimum vertex pointer.
Definition: bbox_3d.h:183
const SFVEC3F & Max() const
Return the maximum vertex pointer.
Definition: bbox_3d.h:190
Frustum is a implementation based on a tutorial by http://www.lighthouse3d.com/tutorials/view-frustum...
Definition: camera.h:48
float angle
Definition: camera.h:59
float fh
Definition: camera.h:60
float nh
Definition: camera.h:60
float fw
Definition: camera.h:60
float farD
Definition: camera.h:59
float nw
Definition: camera.h:60
float nearD
Definition: camera.h:59
Definition: ray.h:63
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:35
SFVEC3F at(float t) const
Definition: ray.h:84
Declaration for a track ball camera.
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44