Defining Complex Collision Boxes and Classes
1 reply to this topic
Members - Reputation: 122
Posted 22 November 2001 - 05:02 PM
I am using very odd colision boxes to create levels in my game the shape is a basicly a triangular prism with either the top or the bottom surface at an odd angle... ASCII ART TIME .-_ /| __-. ./--- | | | | | | | | | | | | | | | | .--.----. that would be an orthographic view from the side of one of the boxes...the bottom of the box lays on the xz plane your looking at the xy plane my question is, how should the box be defined in 3d space? float floor_y; vector odd_angle_place_points i am going to need to do operations against the box to determine how objects will move along the surface and against the walls. more important question, would classes be approiate for this? i am not very familar with them and have never used them before but they seem like they would do the job, i could put functions in the class for evaluating how the player would move against the box by calling one function from the main loop that says somthing like evaluatate this player posistion against your box. classes would also allow me to use other shapes and sence the code would be internal to the class it would only return the players involvment with the box, not worry about what the shape was that the player interacted with. this would be nice because i could use simple boxes for parts of what i need to do, it would reduce the complex math the computer would have to do... if anyone could give me some advice on this it''d really be appreciated, or if someone could just point me to some good information/refrence on using classes that would be great.