mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
Physics stuff Float -> Double
Former-commit-id: 54ccee75769691aa6aaa2416767bd15270f63347 Former-commit-id: 61e892434f48adf11e3ca49b60928a930fd5cde9
This commit is contained in:
@@ -32,7 +32,7 @@ constructor(//properties
|
||||
//public World physWorld = new World( new Vec2(0, -TerrarumMain.game.gravitationalAccel) );
|
||||
//physics
|
||||
/** \[m / s^2\] */
|
||||
var gravitation: Float = 9.8.toFloat()
|
||||
var gravitation: Double = 9.8
|
||||
/** RGB in Integer */
|
||||
var globalLight: Int = 0
|
||||
val worldTime: WorldTime
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package net.torvald.terrarum.gamemap
|
||||
|
||||
import net.torvald.point.Point2f
|
||||
import net.torvald.point.Point2d
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
class MapPoint {
|
||||
var startPoint: Point2f? = null
|
||||
var startPoint: Point2d? = null
|
||||
private set
|
||||
var endPoint: Point2f? = null
|
||||
var endPoint: Point2d? = null
|
||||
private set
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
constructor(p1: Point2f, p2: Point2f) {
|
||||
constructor(p1: Point2d, p2: Point2d) {
|
||||
setPoint(p1, p2)
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ class MapPoint {
|
||||
setPoint(x1, y1, x2, y2)
|
||||
}
|
||||
|
||||
fun setPoint(p1: Point2f, p2: Point2f) {
|
||||
fun setPoint(p1: Point2d, p2: Point2d) {
|
||||
startPoint = p1
|
||||
endPoint = p2
|
||||
}
|
||||
|
||||
fun setPoint(x1: Int, y1: Int, x2: Int, y2: Int) {
|
||||
startPoint = Point2f(x1.toFloat(), y1.toFloat())
|
||||
endPoint = Point2f(x2.toFloat(), y2.toFloat())
|
||||
startPoint = Point2d(x1.toDouble(), y1.toDouble())
|
||||
endPoint = Point2d(x2.toDouble(), y2.toDouble())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user