Re: getting hpr form pfDCS

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Mon, 17 Feb 1997 21:29:44 +0000


On Feb 17, 4:05pm, Yann Andenmatten wrote:
> Subject: getting hpr form pfDCS
> Hi,
>
> I'm trying to get the hpr values from a pfDCS. I've tried that :
>
> const pfMatrix* m = Coord->getMatPtr();
> if (m != NULL)
> {
> pfCoord* dst=NULL;
> m->getOrthoCoord(dst);
> if (dst == NULL)
> printf("HPR...NULL\n");
> else
> printf(" HPR : %3.2f %3.2f %3.2f\n",
> dst->hpr[0], dst->hpr[1], dst->hpr[2]);
> }
> else
> printf("HPR...NULL2\n");
>
> but dst is NULL. What is wrong ? Is it the best way ?

dst will be NULL because you asign it. The getOrthoCoord
method just writes to an existing pfCoord. Even if it did as you
expected you'd need to pass a double indirection so it could
pass back the address of the coord pointer since the call can never
affect the value in dsd unless you pass it's address.

Before the get method add:
 dst = new pfCoord;
but don't forget to delete it afterwards.

or simply use a pfCoord declaration and pass the pointer
to the get method.

Cheers,
Angus.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:40 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.