Jump to content

  • Log In with Google      Sign In   
  • Create Account

desdemian

Member Since 19 Sep 2004
Offline Last Active Yesterday, 10:43 PM

Posts I've Made

In Topic: c++ inhertiance

13 October 2014 - 10:34 PM

Although i do not disagree with what frob said... here's my answer to your question:

 

If you want this to work:

SteeringVector = target.position  - source.position;

the "position" needs to be a "protected" attribute, not a private one. A class that inherits from another class can't access their private values.

 

 

If you want this to work:

SteeringVector = *target->Getposition  - *source->Getposition

you should write target->GetPosition()... that is why "->" is there, to simplify the (*target). nomenclature.

 

If problems persist, post the errors.

 

 


In Topic: Do you use UML or other diagrams when working without a team?

13 October 2014 - 10:21 PM

Yes.

For solo projects sometimes I sketch class diagrams when I cannot figure out the structure easily... for complex architecture can really make things clear before starting to put out code.

 

I do not use them or save them as documentation, though.


In Topic: what is the correct way to move object along direction

13 October 2014 - 06:32 PM

 

somtimes some object move faster , and I couldnt check for collision, because the steps are too big, how can I solve this ?

 

 

If your cycle can handle it, you could update the really fast objects (for examples: bullets) more than one time per update. Divide the big step in little steps and check them all in one update.

 

Or, you can look into swept collision: one example but google will probably show you more.

 

Cheers.


In Topic: Collision Detection in a GTA-like Game

12 October 2014 - 02:04 PM

Hi mr moon, my suggestion:

 

First, use bouding circles just to know if the other object is close enough.

 

Then, if it is, draw your rotated zombie's current frame to a temporal texture (your graphics library should have a way of doing this, that is, drawing to memory instead of screen... or worst case scenario you have to rotate the sprite yourself, google will show you rotating algorithms).

 

Use that new generated texture to do your standard pixel pixel perfect collision checking.

 

Hope that helps. Bye.


In Topic: How to avoid depth fighting

11 August 2013 - 02:03 PM

There is a property you can set before drawing a polygon: glPolygonOffset.

 

Quoting: "glPolygonOffset is useful for rendering hidden-line images, for applying decals to surfaces (this is your case), and for rendering solids with highlighted edges."
 

What it does it "pulls" or "pushes" the polygon before doing the z test. Thus avoiding the z-fighting.

 

 

Good luck.


PARTNERS