mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-17 13:49:57 +00:00
Use Seismic function for perf
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.dfsek.terra.addons.terrascript.script.functions;
|
||||
|
||||
import com.dfsek.seismic.math.floatingpoint.FloatingPointFunctions;
|
||||
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.ImplementationArguments;
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.Returnable;
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.Scope;
|
||||
@@ -34,9 +36,9 @@ public class GetMarkFunction implements Function<String> {
|
||||
Vector2 xz = Vector2.Mutable.of(x.apply(implementationArguments, scope).doubleValue(),
|
||||
z.apply(implementationArguments, scope).doubleValue()).rotate(arguments.getRotation());
|
||||
|
||||
String mark = arguments.getMark(Vector3.of((int) Math.floor(xz.getX()), (int) Math.floor(
|
||||
String mark = arguments.getMark(Vector3.of(FloatingPointFunctions.floor(xz.getX()), FloatingPointFunctions.floor(
|
||||
y.apply(implementationArguments, scope).doubleValue()),
|
||||
(int) Math.floor(xz.getZ()))
|
||||
FloatingPointFunctions.floor(xz.getZ()))
|
||||
.mutable()
|
||||
.add(arguments.getOrigin().toFloat())
|
||||
.immutable());
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.dfsek.terra.addons.terrascript.script.functions;
|
||||
|
||||
import com.dfsek.seismic.math.floatingpoint.FloatingPointFunctions;
|
||||
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.ImplementationArguments;
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.Returnable;
|
||||
import com.dfsek.terra.addons.terrascript.parser.lang.Scope;
|
||||
@@ -37,10 +39,10 @@ public class SetMarkFunction implements Function<Void> {
|
||||
z.apply(implementationArguments, scope).doubleValue()).rotate(arguments.getRotation());
|
||||
|
||||
|
||||
arguments.setMark(Vector3.of((int) Math.floor(xz.getX()),
|
||||
(int) Math.floor(
|
||||
arguments.setMark(Vector3.of(FloatingPointFunctions.floor(xz.getX()),
|
||||
FloatingPointFunctions.floor(
|
||||
y.apply(implementationArguments, scope).doubleValue()),
|
||||
(int) Math.floor(xz.getZ())).mutable().add(arguments.getOrigin().toFloat()).immutable(),
|
||||
FloatingPointFunctions.floor(xz.getZ())).mutable().add(arguments.getOrigin().toFloat()).immutable(),
|
||||
mark.apply(implementationArguments, scope));
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user