-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(JOML): migrate block networks #15
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,9 @@ | |
*/ | ||
package org.terasology.blockNetwork; | ||
|
||
import org.joml.Vector3i; | ||
import org.joml.Vector3ic; | ||
import org.terasology.math.Side; | ||
import org.terasology.math.geom.Vector3i; | ||
|
||
/** | ||
* Contains a block location immutably. | ||
|
@@ -36,11 +37,11 @@ public class ImmutableBlockLocation { | |
* z-coordinate of the location. | ||
*/ | ||
public final int z; | ||
public ImmutableBlockLocation(Vector3i location) { | ||
this(location.x, location.y, location.z); | ||
|
||
public ImmutableBlockLocation(Vector3ic location) { | ||
this(location.x(), location.y(), location.z()); | ||
} | ||
|
||
/** | ||
* ImmutableBlockLocation constructor. | ||
* | ||
|
@@ -53,7 +54,7 @@ public ImmutableBlockLocation(int x, int y, int z) { | |
this.y = y; | ||
this.z = z; | ||
} | ||
|
||
/** | ||
* Creates a new ImmutableBlockLocation in a relative location. | ||
* | ||
|
@@ -62,10 +63,10 @@ public ImmutableBlockLocation(int x, int y, int z) { | |
* of the directionVector to y, and the z-component of the directionVector to z. | ||
*/ | ||
public ImmutableBlockLocation move(Side side) { | ||
final Vector3i directionVector = side.getVector3i(); | ||
return new ImmutableBlockLocation(x + directionVector.x, y + directionVector.y, z + directionVector.z); | ||
final Vector3ic directionVector = side.direction(); | ||
return new ImmutableBlockLocation(x + directionVector.x(), y + directionVector.y(), z + directionVector.z()); | ||
} | ||
Comment on lines
65
to
68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is equivalent to the following, and I think we don't need a full class for this. immutablePos.translate(side.getVector3i(), new Vector3i()); |
||
|
||
/** | ||
* Creates a Vector3i. | ||
* | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this whole class just be removed in favor of
Vector3ic
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can but the module doesn't really work and the way it works is very limited. I rather just make the changes to drop the dependencies to the deprecated methods.