-
Notifications
You must be signed in to change notification settings - Fork 7
Transform Utilities
Swifter edited this page Nov 5, 2024
·
12 revisions
The rm.Transform type in ReMapper is used to represent a position, rotation, and scale.
type Transform = {
position?: rm.Vec3,
rotation?: rm.Vec3,
scale?: rm.Vec3
}All properties are optional. The default values for each property are:
-
position:[0, 0, 0] -
rotation:[0, 0, 0] -
scale:[1, 1, 1]
There's also rm.AnimatedTransform which is structured similarly, but allows points. (See What are points?)
type AnimatedTransform = {
position?: rm.RawPointsVec3,
rotation?: rm.RawPointsVec3,
scale?: rm.RawPointsVec3
}-
rm.combineTransformstakes in a child and parent transform and returns the result of applying the parent to the child.
rm.combineTransforms({
position: [0, 10, 0]
}, {
scale: [2, 2, 2]
})
/*
{
position: [0, 20, 0],
rotation: [0, 0, 0],
scale: [2, 2, 2]
}
*/You also have the option to pass in an anchor value. This will perform the transformation as though this position was the origin.
rm.combineTransforms({
position: [0, 10, 0]
}, {
scale: [2, 2, 2]
}, [0, 10, 0])
/*
{
position: [0, 10, 0],
rotation: [0, 0, 0],
scale: [2, 2, 2]
}
*/-
rm.emulateParentworks much likerm.combineTransforms, but it allows animated transforms as well. It will attempt to userm.combineTransforms, unless one of the transforms are animated. In that case, it will use the baking system.
rm.emulateParent({
position: [0, 10, 0],
}, {
scale: [
[1, 1, 1, 0],
[2, 2, 2, 1],
],
})
/*
{
position: [
[0, 10, 0, 0],
[0, 20, 0, 1]
],
rotation: [
[0, 0, 0, 0],
[0, 0, 0, 1]
],
scale: [
[1, 1, 1, 0],
[2, 2, 2, 1],
],
}
*/-
rm.applyTransformToPointtakes in a point and a transform and returns the result of applying the transform to the point.
rm.applyTransformToPoint([0, 0, 10], {
position: [0, 20, 0],
rotation: [0, 90, 0]
}) // ~ [10, 20, 0]Similarly to rm.combineTransforms, you can provide an anchor value. This will perform the transformation as though this position was the origin.
rm.applyTransformToPoint([0, 0, 10], {
position: [0, 20, 0],
rotation: [0, 90, 0]
}, [0, 0, 10]) // ~ [0, 20, 10]- Info
- Difficulty
- Beatmap Objects
- Gameplay Objects
- Walls
- Basic Notemods
- Note Iterators
- Basic Events
- V3 Events
- Custom Events
- Heck Tracks and Animation
- Easings
- Point Types
- Point Utilities
- Heck Animation Baking
- Heck Animation Settings
Non-Vivify Models
Vivify