Source Code Question: Angles

1 reply [Last post]
xindon
User offline. Last seen 11 years 25 weeks ago. Offline
Joined: 2009-03-03
Posts: 4

Hi guys,

first of all: great game! Hedgewars rocks! Smile

Just for fun I browsed the source code a little bit and came across several sections using trigonometric functions.

Your sine table ranges from 0 to 1024 and angles seem to be in [0, 2048] (correct me if I'm wrong). What's your formula for converting normal angles (e.g. degrees)? Moreover I don't really get the resulting values in the sine table? How are these converted?

Why do you use sine tables? Is there really a noticeable performance benefit?

Thank you Smile

Tim

Uriah
Uriah's picture
User offline. Last seen 12 years 12 weeks ago. Offline
Joined: 2008-01-25
Posts: 359

I can't answer this question (game/graphics designer here) but if you drop by the IRC channel you'll find a number of people who can answer these questions and help you out.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]