• What do you need help with? Version 5
    5,752 replies, posted
[QUOTE=luavirusfree;39124394]Easier to help with: Is physcollide data.HitNormal.z on a scale of 90? Such as this: 1.0=-90, 0.5=-45, 0=0, -0.5=45, -1.0=90 or 1 = Straight Up, 0 = Level to gravity, -1 = straight down. Or is it reversed. since -90° is UP, and +90° is DOWN in Source? Thus, -1 is up, and +1 is down... 0 is still level to gravity.[/QUOTE]The surface normal doesn't linearly represent the angle of the hit. The z element of a normal would be 1 if it is facing directly up, and -1 if facing directly down. Anything else requires the use of the x and y elements and trigonometry to determine the actual hit angle. Imagine a normal vector as an arrow pointing from (0,0,0) to its value if that helps. Could you tell me what the HitNormal is describing exactly so I can help you further? Is it the normal of the surface it hit, or is it something else?
[QUOTE=Staneh;39124783]I have a question, does Box2D support circle-collision? I've only seen people make boxes with it, and that's about it.[/QUOTE] So you've never played angry birds? Because it's in box2d.
[QUOTE=Topgamer7;39124817]So you've never played angry birds? Because it's in box2d.[/QUOTE] Wow, didn't know that. Thanks.
Anyone here ever had any troubles with SDL_mixer crashing during midi music changes related to altering the song's channel volume? I've been getting segv'd by that for quite a while now, fun fact is, it doesn't happen when I play .ogg or .wav Another question, what free, GPL library can I use to play midi files?
I'm trying to convert a formula I found for getting the bearing between two gps coordinates, from javascript to java (That in itself is no problem). There's a variable in the formula that I don't know where it originates from, any help? The formula is from [URL="http://www.movable-type.co.uk/scripts/latlong.html"]here[/URL] [cpp] var y = Math.sin(dLon) * Math.cos(lat2); var x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon); var brng = Math.atan2(y, x).toDeg(); [/cpp]
[QUOTE=Staneh;39124783]I have a question, does Box2D support circle-collision? I've only seen people make boxes with it, and that's about it.[/QUOTE] Yes [img]https://dl.dropbox.com/u/19560951/Water/2012-12-19_013212.png[/img]
[QUOTE=Armandur;39129133]I'm trying to convert a formula I found for getting the bearing between two gps coordinates, from javascript to java (That in itself is no problem). There's a variable in the formula that I don't know where it originates from, any help? The formula is from [URL="http://www.movable-type.co.uk/scripts/latlong.html"]here[/URL] [cpp] var y = Math.sin(dLon) * Math.cos(lat2); var x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon); var brng = Math.atan2(y, x).toDeg(); [/cpp][/QUOTE] What variable? lat2 is latitude of the second point lat1 is latitude of the first point dLon is delta longitude, or lon2-lon1
[QUOTE=ThePuska;39129219]What variable? lat2 is latitude of the second point lat1 is latitude of the first point dLon is delta longitude, or lon2-lon1[/QUOTE] Sorry, yeah dlon was what I was missing, thanks :)
-nevermind, found solution-
Any idea why I am getting these errors? [CODE] 8|error: expected unqualified-id before ')' token| 9|error: expected class-name before '(' token| 6|error: an anonymous struct cannot have function members| 24|error: abstract declarator '<anonymous class>' used as declaration| [/CODE] [CODE] #ifndef MouseWrapper #define MouseWrapper #include <SFML/Window/Mouse.hpp> class MouseWrapper { public: MouseWrapper(); ~MouseWrapper(); int X(); int Y(); bool left(); bool lastleft(); bool right(); bool lastright(); void Update(); private: int x; int y; bool LEFT; bool LLEFT; bool RIGHT; bool LRIGHT; }; #endif // MouseWrapper [/CODE] SOLVED #define was not in all caps.
[QUOTE=CmdrMatthew;39124794]The surface normal doesn't linearly represent the angle of the hit. The z element of a normal would be 1 if it is facing directly up, and -1 if facing directly down. Anything else requires the use of the x and y elements and trigonometry to determine the actual hit angle. Imagine a normal vector as an arrow pointing from (0,0,0) to its value if that helps. Could you tell me what the HitNormal is describing exactly so I can help you further? Is it the normal of the surface it hit, or is it something else?[/QUOTE] The Normal of a surface that Mario's Fireballs may bounce off of. If the normal is 1, or -1, it will destroy the ball. [editline]7th January 2013[/editline] Uhm, how do I turn a hit normal into an angle? Sorry if this double-posts.
[QUOTE=CmdrMatthew;39124794]The surface normal doesn't linearly represent the angle of the hit. The z element of a normal would be 1 if it is facing directly up, and -1 if facing directly down. Anything else requires the use of the x and y elements and trigonometry to determine the actual hit angle. Imagine a normal vector as an arrow pointing from (0,0,0) to its value if that helps. Could you tell me what the HitNormal is describing exactly so I can help you further? Is it the normal of the surface it hit, or is it something else?[/QUOTE] You can find the angle of incidence given the normal of the surface and the direction vector of the projectile by using: theta = arccos(a.b/|a||b|) where a and b are the normal and direction.
Been considering transitioning to C++ from Java for a while, now I've decided. What's the best free IDE for C++ ?
This is dumb (on my part), but I seem to get next to no help at all on this thread.
Maybe it's because people don't understand you and you don't understand the answers that were given to you.
[QUOTE=luavirusfree;39132787]The Normal of a surface that Mario's Fireballs may bounce off of. If the normal is 1, or -1, it will destroy the ball. [editline]7th January 2013[/editline] Uhm, how do I turn a hit normal into an angle? Sorry if this double-posts.[/QUOTE] Are you talking about a two-dimensional normal vector? Then you can use [URL=http://en.wikipedia.org/wiki/Atan2]atan2[/URL].
[QUOTE=farmatyr;39133494]Been considering transitioning to C++ from Java for a while, now I've decided. What's the best free IDE for C++ ?[/QUOTE] Eclipse or Notepad++ (Kate in case you're a linux user.)
[QUOTE=JohnnyOnFlame;39133957]Eclipse or Notepad++ (Kate in case you're a linux user.)[/QUOTE] NP++ isn't an IDE tho. (Also there's Geany too if you're not a KDE person)
3 Dimensions. (Mario Fireballs) I don't want to do it 2D, since I will have at least one 3D level, where you aren't side-scrolling. I get more help here than in the Lua Help Thread... I understand what everyone is saying, though.
I fucking love Kate. Just throwing that out there.
I'm trying to make a multiplayer game for a school project, but I can't seem to communicate between PCs. I understand if it's because ports are blocked, however halo ce is playable, and using their ports I am still unable to send packets. I'm using java, and the comps are on the same LAN. Any ideas?
[QUOTE=luavirusfree;39134152]3 Dimensions. (Mario Fireballs) I don't want to do it 2D, since I will have at least one 3D level, where you aren't side-scrolling. I get more help here than in the Lua Help Thread... I understand what everyone is saying, though.[/QUOTE] If you scroll up you'll find I did tell you how to find the angle you're after
I don't recall the meaning of theta... lol. Is that a variable in a trigonometric function?
Theta is the angle.
Mkays, t-thank-thou.! Uhm, how would I write that? "theta = arccos(a.b/|a||b|) where a and b are the normal and direction." colang=arccos(normal.dir/|normal||dir| ??? ???
[QUOTE=luavirusfree;39134740]I don't recall the meaning of theta... lol. Is that a variable in a trigonometric function?[/QUOTE] You're going to have a hard time programming anything relating to transformations in a 2D/3D space if you don't know your trig. I'd suggest you brush up on it.
I learned basic trig... and trig for physics. I remember some, but I never learned theta, only "Angle=Cos of X" ... .
I need some help with PyGame. I'm trying to get the surface object to move when I drag it with my mouse. I've already tried using mouse.get_pos() and mouse.get_rel() with surface.scroll(), but I can't seem to figure it out. Any help is appreciated.
[QUOTE=WTF Nuke;39134492]I'm trying to make a multiplayer game for a school project, but I can't seem to communicate between PCs. I understand if it's because ports are blocked, however halo ce is playable, and using their ports I am still unable to send packets. I'm using java, and the comps are on the same LAN. Any ideas?[/QUOTE] Ports shouldn't really be blocked within the LAN unless manually done. Are you using TCP or UDP?
So ive been programming a TCP server in PHP but i've been looking to redo it in another language, i was looking at node / ruby, what would you people suggest? I couldn't find any good guides for setting up ruby on osx for application development, there are plenty for rails but i don't want that. Node seems pretty good but id rather not use javascript. Any suggestions are welcome
Sorry, you need to Log In to post a reply to this thread.