Skip to content

Commit

Permalink
refactor(form): refactor form to from (Orillusion#118)
Browse files Browse the repository at this point in the history
refactor form to from
  • Loading branch information
hellmor authored May 8, 2023
1 parent cfe792c commit 8c28e4f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/components/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Transform extends ComponentBase {

/**
*
* The transformation property of the object relative to the parent, stored in the form of a quaternion
* The transformation property of the object relative to the parent, stored in the from of a quaternion
*/
public get localRotQuat(): Quaternion {
return this._localRotQuat;
Expand Down
4 changes: 2 additions & 2 deletions src/components/lights/IESProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export class IESProfiles {
}

/**
* create ies image form ies file
* create ies image from ies file
*/
private generateIES(file: any) {
//TODO add create ies image form ies file
//TODO add create ies image from ies file
}

public set IESTexture(texture: Texture) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/GeometryBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class GeometryBase {
}

/**
* add subGeometry form lod level
* add subGeometry from lod level
* @param lodLevels @see LodLevel
*/
public addSubGeometry(...lodLevels: LodLevel[]) {
Expand Down
14 changes: 7 additions & 7 deletions src/core/geometry/GeometryIndicesBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export class GeometryIndicesBuffer {
}

/**
* Get indices form geometry data
* Get position attribute form geometry data
* Get normal attribute form geometry data
* Get tangent attribute form geometry data
* Get uv0 attribute form geometry data
* Get uv1 attribute form geometry data
* Get uv2 attribute form geometry data
* Get indices from geometry data
* Get position attribute from geometry data
* Get normal attribute from geometry data
* Get tangent attribute from geometry data
* Get uv0 attribute from geometry data
* Get uv1 attribute from geometry data
* Get uv2 attribute from geometry data
*
* Change position data to GPUBuffer and apply
* Change normal data to GPUBuffer and apply
Expand Down
4 changes: 2 additions & 2 deletions src/io/OutlinePostData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class OutlinePostData {
public clearAt(slotIndex: number): this {
this.dataDirty = true;
let slot: OutlinePostSlot = this.slots[slotIndex];
slot.color.copyForm(this.defaultColor);
slot.color.copyFrom(this.defaultColor);
slot.indexList.fill(-1);
slot.count = 0;
return this;
Expand All @@ -51,7 +51,7 @@ export class OutlinePostData {
data.indexList[i] = indexList[i];
}
data.count = indexList.length;
data.color.copyForm(color);
data.color.copyFrom(color);
}
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/math/AnimationCurve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class AnimationCurve {
}

/**
* remove keyframe form this curve
* remove keyframe from this curve
* @param keyFrame {@link Keyframe}
*/
public removeKeyFrame(keyFrame: Keyframe) {
Expand Down
4 changes: 2 additions & 2 deletions src/math/Bezier3D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class Bezier3D {
private static tmp_points: Vector3[] = [];

/**
* get cubic curve point value form t at bezier data
* get cubic curve point value from t at bezier data
* @param t interval value
* @param p0 start point
* @param c1 left control point
Expand Down Expand Up @@ -40,7 +40,7 @@ export class Bezier3D {
}

/**
* get curve point form three point bezier curve
* get curve point from three point bezier curve
* @param t interval value
* @param p0 start point
* @param c1 contrl point
Expand Down
18 changes: 9 additions & 9 deletions src/math/Color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Color {
}

/**
* update this color rgb form hexadecimal no alpha
* update this color rgb from hexadecimal no alpha
* @param value
*/
public hexToRGB(value: number) {
Expand All @@ -128,7 +128,7 @@ export class Color {
}

/**
* update this color rgb form hexadecimal has alpha
* update this color rgb from hexadecimal has alpha
* @param value
*/
public hexToRGBA(value: number) {
Expand Down Expand Up @@ -166,7 +166,7 @@ export class Color {
}

/**
* update this color rgba form hexadecimal
* update this color rgba from hexadecimal
* @param hex hex string.
*/
public setHex(hex: string) {
Expand Down Expand Up @@ -251,14 +251,14 @@ export class Color {
* @returns
*/
public clone(): Color {
return new Color().copyForm(this);
return new Color().copyFrom(this);
}

/**
* copy color form source color
* copy color from source color
* @returns
*/
public copyForm(src: Color): this {
public copyFrom(src: Color): this {
this.r = src.r;
this.g = src.g;
this.b = src.b;
Expand All @@ -267,12 +267,12 @@ export class Color {
}

/**
* copy color form array
* copy color from array
* @param arr [ 255 , 255 , 255 , 255 ]
* @param scalar
* @returns
*/
public copyFormArray(arr: number[], scalar: number = 255) {
public copyFromArray(arr: number[], scalar: number = 255) {
this.r = arr[0] / scalar;
this.g = arr[1] / scalar;
this.b = arr[2] / scalar;
Expand All @@ -281,7 +281,7 @@ export class Color {
}

/**
* update this color rgb form hexadecimal no alpha
* update this color rgb from hexadecimal no alpha
* @param hexColor rgb color
* @param dst ref out color
*/
Expand Down
4 changes: 2 additions & 2 deletions src/math/Matrix4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export class Matrix4 {
}

/**
* set matrix form two direction
* set matrix from two direction
* @param fromDirection first direction
* @param toDirection second direction
* @version Orillusion3D 0.5.1
Expand Down Expand Up @@ -2046,7 +2046,7 @@ export class Matrix4 {
}

/**
* form unity AMath.PI
* from unity AMath.PI
*/
public setTRInverse(pos: Vector3, q: Quaternion) {
q = q.inverse();
Expand Down
2 changes: 1 addition & 1 deletion test/math/Color.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ await test('Color hdr test', async () => {

await test('Color Copy test', async () => {
let color = new Color(1, 0.0, 0.0, 1.0);
color.copyFormArray([255, 255, 255, 255], 255);
color.copyFromArray([255, 255, 255, 255], 255);

expect(color.r).toEqual(1);
expect(color.g).toEqual(1);
Expand Down

0 comments on commit 8c28e4f

Please sign in to comment.