• Advertisement
Sign in to follow this  

noob error and confused ?

This topic is 2331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



class CArc
{
private:

public:
float m_arcAngle;
CArc(){ m_arcAngle = 45;}
inline float GetArc() { return m_arcAngle;}
inline void SetArc(float amount) { m_arcAngle = amount;}
inline void UpdateArc(float amount) { m_arcAngle += amount;}
};




class CLightSpot :
public CBaseLight
{
private:
CArc Arc;
public:
CArc GetArc() { return Arc;}
CLightSpot(void);
~CLightSpot(void);

public:

};



CLightSpot* spotLight = new CLightSpot;

spotlight->GetArc().SetArc(90);

float tt = spotlight->GetArc().GetArc();

float tt will equal 45 , the original setting

can any one expplain how to set it correctly , with out making ARc arc into ARc* arc;

really confused

Share this post


Link to post
Share on other sites
Advertisement
You could change CLightSpot::GetArc() to return a CArc & instead of a CArc.

Share this post


Link to post
Share on other sites

You could change CLightSpot::GetArc() to return a CArc & instead of a CArc.




cheers mate , been at back off my mind for about 3 weeks. would not mind but designing a game engine and 3rd at uni doing it , lol

Share this post


Link to post
Share on other sites
It is very key that you understand *why* SiCrane's recommendation worked if you don't already know. This is a very key concept in c++

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement