-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add off road, refactor wheels, allow other entities to be boosted on …
…dash panels
- Loading branch information
1 parent
521b7b9
commit bdd61b1
Showing
31 changed files
with
413 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/io/github/foundationgames/automobility/automobile/BasicWheelBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.foundationgames.automobility.automobile; | ||
|
||
public class BasicWheelBase extends WheelBase { | ||
public BasicWheelBase(float sepLong, float sepWide) { | ||
super( | ||
new WheelPos(sepLong / 2, sepWide / -2, 1, 0, WheelEnd.FRONT, WheelSide.LEFT), | ||
new WheelPos(sepLong / -2, sepWide / -2, 1, 0, WheelEnd.BACK, WheelSide.LEFT), | ||
new WheelPos(sepLong / 2, sepWide / 2, 1, 180, WheelEnd.FRONT, WheelSide.RIGHT), | ||
new WheelPos(sepLong / -2, sepWide / 2, 1, 180, WheelEnd.BACK, WheelSide.RIGHT) | ||
); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/io/github/foundationgames/automobility/automobile/WheelBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.foundationgames.automobility.automobile; | ||
|
||
public class WheelBase { | ||
public final WheelPos[] wheels; | ||
|
||
public WheelBase(WheelPos ... wheels) { | ||
this.wheels = wheels; | ||
} | ||
|
||
public enum WheelSide { | ||
LEFT, | ||
RIGHT | ||
} | ||
|
||
public enum WheelEnd { | ||
FRONT, | ||
BACK | ||
} | ||
|
||
public static record WheelPos(float forward, float right, float scale, float yaw, WheelEnd end, WheelSide side) {} | ||
|
||
public static WheelBase basic(float separationLong, float separationWide) { | ||
return new BasicWheelBase(separationLong, separationWide); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.