This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
添加常用向量结构和一些特定形状结构 #44
Draft
BAKAOLC
wants to merge
72
commits into
Legacy-LuaSTG-Engine:master
Choose a base branch
from
BAKAOLC:ffi_vector
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or 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
Geometric Shape: Triangle
These additions establish a solid mathematical foundation for further development in game physics, geometry, and spatial computations. |
Line Implementation:
|
Summary of Changes:
|
|
…gment, and Triangle classes
|
|
…Polygon, Ray, Rectangle, Sector, Segment, and Triangle classes
|
…urve and Ellipse classes
ffi struct
|
aa15ad4
to
e23131c
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request introduces new implementations for 2D, 3D, and 4D vector classes in Lua using the
ffi
library. These classes provide various mathematical operations, utility methods, and compatibility with LuaSTG Evo. Below is a summary of the most important changes:2D Vector (
Vector2
)Vector2
class with fieldsx
andy
, operator overloads for arithmetic operations (+
,-
,*
,/
), unary negation, equality, and string representation.length
,angle
,dot
,normalize
, andnormalized
for vector operations.Vector2
creation vialstg.Vector2
.3D Vector (
Vector3
)Vector3
class with fieldsx
,y
, andz
, along with operator overloads for arithmetic operations, unary negation, equality, and string representation.length
,dot
,normalize
, andnormalized
for 3D vector operations.4D Vector (
Vector4
)Vector4
class with fieldsx
,y
,z
, andw
, along with operator overloads for arithmetic operations, unary negation, equality, and string representation.length
,dot
,normalize
, andnormalized
for 4D vector operations.These changes enhance the mathematical foundation of the project by introducing efficient, reusable vector classes with extensive functionality.