Sign in to follow this  
thedodgeruk

noob error and confused ?

Recommended Posts

[code]

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:

};

[/code]

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
[quote name='SiCrane' timestamp='1318021354' post='4870260']
You could change CLightSpot::GetArc() to return a CArc & instead of a CArc.
[/quote]



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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this