Author Topic: Perps? - What are poly's perps in Soldat maps and what are they good for?  (Read 5006 times)

0 Members and 1 Guest are viewing this topic.

Offline laB

  • Major(1)
  • Posts: 8
Hello, can someone explain me, what (and what for) are poly's perps in Soldat map, and how to calculate them? Very please :)

EDIT: fixed bad topic subject
« Last Edit: July 08, 2011, 03:15:04 pm by Shoozza »

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
I'll bug Fryer about it. He'll know answer for sure.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Fryer

  • Camper
  • ***
  • Posts: 261
  • Game dev
"Perp" is short for "perpendicular", which is the direction in which the side of the polygon is facing. Since polygons in Soldat have 3 sides, they also have 3 perpendiculars.

To calculate the perpendicular (Perp) of a polygon with vertices ordered in a clockwise order between vertex V_1 and V_2, use this code:
Code: [Select]
Diff.X = V_2.Y - V_1.Y
Diff.Y = V_2.X - V_1.X
Length = sqrt(Diff.X^2 + Diff.Y^2)
Perp.X = Diff.Y/Length
Perp.Y = Diff.X/Length

On bouncy polygons the length of the perpendicular indicates the polygon's bounce power (1 = no bounce). Calculating the perpendiculars with a bounciness factor (B) can be done like this:
Code: [Select]
Perp.X = Perp.X*B
Perp.Y = Perp.Y*B

The reason this information is saved in the map format is probably speed, but the perpendiculars could be calculated when the map is loaded in Soldat instead, so I don't really know why MM decided to make it the map editors responsibility... :P
« Last Edit: July 08, 2011, 07:55:53 pm by Fryer »
...PC vs Mac is like AK47 vs M4A1...
<DutchFlame`> i once heard running runescape in the background gave you a speedboost
<Mr> yes, it allocates more electrons, so there are more electrons available for Soldat -> they are streched less and it is more fluent

Soldat PolyWorks 1.5.0.13 - AimMode - Aim practise gamemode script - Fryer's SoldatStream Mod

Offline laB

  • Major(1)
  • Posts: 8
Now I understand :)
Thanks, Fryer.