![]() |
Corners of a rectangle
I spent half of my afternoon trying to get the blocking of Era cars right, by calculating each corner based on the center, angle, and a fixed size of 2x4 tiles of a car.
I wonder whether this is of use to anybody, or whether someone wants to make it nicer. NPC Code:a = this.carAng; |
Ahh, but the horizontal and vertical distances between the player's coordinates and the coordinates of the car change, though...? (depending on the angle of the car)
i.e. if the car is facing up, the center of the car will be to the right and down of the player, whereas if the car is facing down, the center of the car will be to the left and up of the player... Some more trigonometry is required, no? |
Quote:
|
| All times are GMT +2. The time now is 08:45 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.