S
Steven T. Hatton
I'm in a situation where I want to be sure all my data is organized in a
specific pattern in memory. The array is vertex data which I want to
represent as individual vectors per vertex, and per vertex type. That is,
the array has data such as position, color, normal vectors, etc. I wrote
what I consider to be a pretty nice vector class template and a
corresponding matrix template. The vector I have stores its data locally,
rather than through a reference or pointer.
I want virtuall the same behavior as the current vector gives me, with the
exception that the data should be a reference into the vertex array. If I
derive from vector to create a vectorRef class, I'm pretty sure I'll need
to make most of the functions in the vector virtual. My understanding is
doing so will mean that they will not be inlined because the actual call is
determined after compilation.
Is there a standard strategy for dealing with this kind of situation?
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
specific pattern in memory. The array is vertex data which I want to
represent as individual vectors per vertex, and per vertex type. That is,
the array has data such as position, color, normal vectors, etc. I wrote
what I consider to be a pretty nice vector class template and a
corresponding matrix template. The vector I have stores its data locally,
rather than through a reference or pointer.
I want virtuall the same behavior as the current vector gives me, with the
exception that the data should be a reference into the vertex array. If I
derive from vector to create a vectorRef class, I'm pretty sure I'll need
to make most of the functions in the vector virtual. My understanding is
doing so will mean that they will not be inlined because the actual call is
determined after compilation.
Is there a standard strategy for dealing with this kind of situation?
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell