VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtInstanceState.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 
13 #include <osg/Matrixf>
14 #include <osg/Vec3d>
15 
16 namespace makVrv
17 {
20  struct ArrayRange
21  {
23  ArrayRange(unsigned _offset, unsigned _count)
24  : offset(_offset)
25  , count(_count)
26  {
27 
28  }
29 
32  : offset(0)
33  , count(0)
34  {
35 
36  }
37 
39  unsigned int offset;
40 
42  unsigned int count;
43  };
44 
46  typedef osg::Matrixf InstanceMatrix;
47  typedef float InstanceMatrixVal;
48 
52  {
54  osg::Vec3d l2wPos;
55  osg::Vec3f boundingCenter;
58  unsigned int nodeMask;
59  short modelSet;
60 
62  unsigned short templateIndex;
63 
64  bool visible;
65  bool isProp;
66  };
67 
71  {
72  public:
73 
76  : isModelScalingEnabled(true)
77  , scale(1.0f)
78  , cullDataOffset(0)
79  , templateIndex(0)
80  , basePositionDirty(false)
81  , baseOrientationDirty(false)
82  , positionOffsetDirty(false)
83  , orientationOffsetDirty(false)
84  {
85 
86  }
87 
90  osg::Matrixf l2wOri;
91 
93  osg::Vec3f colorFilter;
94 
96  unsigned short cullDataOffset;
97 
100 
103 
106 
109 
112 
115 
118 
121 
123  unsigned short templateIndex;
124 
127 
129  float scale;
130 
132  osg::Vec3d basePosition;
133 
138 
140  osg::Vec3d positionOffset;
141 
146 
148  osg::Matrixf baseOrientation;
149 
152 
154  osg::Matrixf orientationOffset;
155 
158  };
159 }
osg::Vec3d positionOffset
The offset to apply to the base position to determine InstanceCullData::l2wPos.
Definition: DtInstanceState.h:140
osg::Vec3d l2wPos
Important! l2wPos is not valid until updateOffsetsAndDistancesToEye() has been called.
Definition: DtInstanceState.h:54
bool baseOrientationDirty
A new orientation was set this frame.
Definition: DtInstanceState.h:151
float scale
the individual scale from the model definition
Definition: DtInstanceState.h:129
bool isProp
Definition: DtInstanceState.h:65
osg::Vec3f colorFilter
Colorization.
Definition: DtInstanceState.h:93
float boundingRadius
Definition: DtInstanceState.h:56
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned short cullDataOffset
Array offset to per-instance cull data.
Definition: DtInstanceState.h:96
osg::Matrixf l2wOri
Local to world orientation matrix.
Definition: DtInstanceState.h:90
ArrayRange uvOffsetRange
Range of UV offsets in this instance.
Definition: DtInstanceState.h:117
unsigned int nodeMask
Definition: DtInstanceState.h:58
ArrayRange sequenceRange
Range of instanced sequences in this instance.
Definition: DtInstanceState.h:105
osg::Matrixf orientationOffset
The current orientation offset to apply to the baseOrientation to determine l2wOri.
Definition: DtInstanceState.h:154
bool positionOffsetDirty
If the base position or the position offset have changed or the base orientation have changed...
Definition: DtInstanceState.h:145
bool basePositionDirty
If the base position or the position offset have changed or the base orientation have changed...
Definition: DtInstanceState.h:137
unsigned int count
Number of drawables in the range.
Definition: DtInstanceState.h:42
bool isModelScalingEnabled
Model scaling for the instance.
Definition: DtInstanceState.h:126
Specifies a range of drawables in the drawable array.
Definition: DtInstanceState.h:20
unsigned short templateIndex
Index to instance template data for this instance.
Definition: DtInstanceState.h:123
osg::Matrixf InstanceMatrix
Type of osg matrix to use for transforms relative to instance base.
Definition: DtInstanceState.h:46
ArrayRange(unsigned _offset, unsigned _count)
CTOR.
Definition: DtInstanceState.h:23
float InstanceMatrixVal
Definition: DtInstanceState.h:47
ArrayRange dofRange
Range of instanced DOF nodes in this instance.
Definition: DtInstanceState.h:99
Per-instance culling parameters.
Definition: DtInstanceState.h:51
osg::Vec3f boundingCenter
Definition: DtInstanceState.h:55
ArrayRange lightPointRange
Range of light points in this instance.
Definition: DtInstanceState.h:120
ArrayRange switchRange
Range of instanced switches in this instance.
Definition: DtInstanceState.h:102
ArrayRange lodRange
Range of LODs in this instance.
Definition: DtInstanceState.h:111
float intersectBoundingRadius
Definition: DtInstanceState.h:57
osg::Matrixf baseOrientation
base Local to world orientation matrix
Definition: DtInstanceState.h:148
Contains DLL export macros.
short modelSet
Definition: DtInstanceState.h:59
ArrayRange drawableRange
Range of drawables in this instance.
Definition: DtInstanceState.h:108
unsigned short templateIndex
Index to instance template data for this instance.
Definition: DtInstanceState.h:62
voidpf uLong offset
Definition: ioapi.h:42
bool visible
Definition: DtInstanceState.h:64
bool orientationOffsetDirty
A new orientationOffset was set this frame.
Definition: DtInstanceState.h:157
DtInstanceState()
CTOR.
Definition: DtInstanceState.h:75
ArrayRange()
CTOR.
Definition: DtInstanceState.h:31
osg::Vec3d basePosition
The position of the instance before application of the offset.
Definition: DtInstanceState.h:132
unsigned int offset
Offset into the drawable array.
Definition: DtInstanceState.h:39
Per-instance state information.
Definition: DtInstanceState.h:70
ArrayRange lightRange
Range of light sources in this instance.
Definition: DtInstanceState.h:114

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)