Veraart (rioj7++at++fel.tno.nl)
Wed, 6 Mar 1996 14:00:31 +0100 (MET)
That would be the best.
So you can change the implementation and not the interface.
> Why does pfVec3, being a class, allow access to its 3 components.
Maybe to let people mix C api and C++ api.
>
> And since this happens what is the difference between these two sources:
> a)
> pfVec3 p;
> p.set(1.0f, 2.0f, 3.0f);
> b)
> pfVec3 p;
> p[0]=1.0f;
> p[1]=2.0f;
> p[2]=3.0f;
> Is b) faster than a)?
There is absolutely no difference because the set method is an
inline method.
> Not knowing a lot about C++ I find it would be normal for a pfVec3 class
> definition to be present in one of the header files. I didn't find it
> anywhere. Where are the pfVec3 methods defined? I found pfVec3 to be
> defined as
> typedef float pfVec3[3];
> Why is this?
The pfVec3 is not a class but a C++ struct. You can find the definition in
/usr/include/Performer/pr/pfLinMath.h line 202. The difference between a
C++ class and C++ struct is the default inheritance, resp private and public.
The typedef float pfVec3[3]; is from the C-api from
/usr/include/Performer/prmath.h
I hope this explains your questions.
Mario
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:31 PDT