Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions types/three/src/nodes/math/MathNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,24 @@ declare module "../core/Node.js" {
}
}

export const sin: (x: FloatOrNumber) => Node<"float">;
export const cos: (x: FloatOrNumber) => Node<"float">;
export const tan: (x: FloatOrNumber) => Node<"float">;
export const asin: (x: FloatOrNumber) => Node<"float">;
export const acos: (x: FloatOrNumber) => Node<"float">;
export const atan: (y: FloatOrNumber, x?: FloatOrNumber) => Node<"float">;
interface TrigonometricFunction {
(x: FloatOrNumber): Node<"float">;
(x: Node<"vec2">): Node<"vec2">;
(x: Node<"vec3">): Node<"vec3">;
(x: Node<"vec4">): Node<"vec4">;
}
interface ArcTanFunction {
(y: FloatOrNumber, x?: FloatOrNumber): Node<"float">;
(y: Node<"vec2">, x?: Vec2OrLessOrFloat): Node<"vec2">;
(y: Node<"vec3">, x?: Vec3OrLessOrFloat): Node<"vec3">;
(y: Node<"vec4">, x?: Vec4OrLessOrFloat): Node<"vec4">;
}
export const sin: TrigonometricFunction;
export const cos: TrigonometricFunction;
export const tan: TrigonometricFunction;
export const asin: TrigonometricFunction;
export const acos: TrigonometricFunction;
export const atan: ArcTanFunction;
declare module "../core/Node.js" {
interface FloatExtensions {
sin: () => Node<"float">;
Expand All @@ -251,6 +263,22 @@ declare module "../core/Node.js" {
acos: () => Node<"float">;
atan: (x?: FloatOrNumber) => Node<"float">;
}
interface FloatVecExtensions<TVec extends FloatVecType> {
sin: () => Node<TVec>;
cos: () => Node<TVec>;
tan: () => Node<TVec>;
asin: () => Node<TVec>;
acos: () => Node<TVec>;
}
interface Vec2Extensions {
atan: (x?: Vec2OrLessOrFloat) => Node<"vec2">;
}
interface Vec3Extensions {
atan: (x?: Vec3OrLessOrFloat) => Node<"vec3">;
}
interface Vec4Extensions {
atan: (x?: Vec4OrLessOrFloat) => Node<"vec4">;
}
}

interface Abs {
Expand Down