Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "pixi3d", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Render in 3D using PixiJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/pixi3d.js", |
@@ -55,8 +55,8 @@ # Pixi3D | ||
### Examples | ||
Included with the source code is a set of examples which shows how to use some | ||
of the different features of Pixi3D. The examples can be found in the folder | ||
*examples/src* and can be run by using the *serve* script. | ||
Included with the source code is a collection of examples which shows how to use | ||
some of the different features of Pixi3D. To be able to run the examples, | ||
download or clone the repository from https://github.com/jnsmalm/pixi3d and run | ||
*npm install*. Browse the examples inside the *examples/src* folder and run them | ||
using the *serve* script. For example, to run the *getting-started* application: | ||
For example, to run the *getting-started* application: | ||
`npm run serve -- --env.example=getting-started` | ||
@@ -63,0 +63,0 @@ |
@@ -7,3 +7,3 @@ import { Camera3D } from "./camera"; | ||
camera: Camera3D; | ||
private _rotation; | ||
private _euler; | ||
private _distance; | ||
@@ -19,7 +19,13 @@ /** Allows the camera to be controlled. */ | ||
/** | ||
* Updates the orbit position by the specified x-axis and y-axis. | ||
* Moves the orbit position by the specified x-axis and y-axis. | ||
* @param x Value for the x-axis. | ||
* @param y Value for the y-axis. | ||
*/ | ||
updateOrbitBy(x: number, y: number): void; | ||
orbitBy(x: number, y: number): void; | ||
/** | ||
* Sets the orbit position to the specified x-axis and y-axis. | ||
* @param x Value for the x-axis (between -75 and 75). | ||
* @param y Value for the y-axis. | ||
*/ | ||
orbitTo(x: number, y: number): void; | ||
} |
import * as PIXI from "pixi.js"; | ||
import { CubeMapResource } from "./cubemap-loader"; | ||
export declare class CubeMipMapTexture extends PIXI.CubeTexture { | ||
export declare class CubeMipMapTexture extends PIXI.BaseTexture { | ||
private _valid?; | ||
@@ -5,0 +5,0 @@ levels: number; |
@@ -1,2 +0,2 @@ | ||
import { MeshVertexAttribute } from "../mesh/mesh-vertex"; | ||
import { MeshGeometryAttribute } from "../mesh/mesh-geometry"; | ||
export declare class glTFBufferAccessor { | ||
@@ -7,3 +7,3 @@ private descriptor; | ||
private createArrayBuffer; | ||
createVertexAttribute(attribute: number): MeshVertexAttribute; | ||
createGeometryAttribute(attribute: number): MeshGeometryAttribute; | ||
} |
@@ -20,3 +20,3 @@ import { MaterialFactory } from "../material"; | ||
createMesh(meshIndex?: number): Mesh3D; | ||
private createMeshVertexData; | ||
private createMeshGeometry; | ||
private getPositions; | ||
@@ -23,0 +23,0 @@ private getNormals; |
@@ -10,2 +10,3 @@ export { glTFLoader } from "./gltf/loader"; | ||
export { Mesh3D } from "./mesh/mesh"; | ||
export { MeshGeometry } from "./mesh/mesh-geometry"; | ||
export { Model3D } from "./model"; | ||
@@ -12,0 +13,0 @@ export { LightingEnvironment } from "./lighting/lighting-environment"; |
@@ -7,3 +7,3 @@ import * as PIXI from "pixi.js"; | ||
export declare class ImageBasedLighting { | ||
diffuse: PIXI.CubeTexture; | ||
diffuse: CubeMipMapTexture; | ||
specular: CubeMipMapTexture; | ||
@@ -17,3 +17,3 @@ brdf?: PIXI.Texture | undefined; | ||
*/ | ||
constructor(diffuse: PIXI.CubeTexture, specular: CubeMipMapTexture, brdf?: PIXI.Texture | undefined); | ||
constructor(diffuse: CubeMipMapTexture, specular: CubeMipMapTexture, brdf?: PIXI.Texture | undefined); | ||
/** | ||
@@ -20,0 +20,0 @@ * Value indicating if the image based lighting object is valid to be used |
import * as PIXI from "pixi.js"; | ||
import { MeshVertexData } from "./mesh/mesh-vertex"; | ||
import { Mesh3D } from "./mesh/mesh"; | ||
import { MeshGeometry } from "./mesh/mesh-geometry"; | ||
/** | ||
* Predefined attributes for material shader. | ||
*/ | ||
export declare enum MaterialShaderAttribute { | ||
/** Expects shader attribute to be "attribute vec3 a_Position". */ | ||
position = "position", | ||
/** Expects shader attribute to be "attribute vec2 a_UV1". */ | ||
uv1 = "uv1", | ||
/** Expects shader attribute to be "attribute vec3 a_Normal". */ | ||
normal = "normal", | ||
/** Expects shader attribute to be "attribute vec4 a_Tangent". */ | ||
tangent = "tangent" | ||
} | ||
/** | ||
* Factory for creating materials. | ||
@@ -28,5 +15,2 @@ */ | ||
export declare abstract class Material { | ||
attributes: MaterialShaderAttribute[]; | ||
protected _geometry?: PIXI.Geometry; | ||
protected _mesh?: Mesh3D; | ||
protected _shader?: PIXI.Shader; | ||
@@ -45,8 +29,4 @@ /** State used to render a mesh. */ | ||
transparent: boolean; | ||
get name(): string; | ||
/** | ||
* Creates a new material. | ||
* @param attributes Predefined attributes for the shader. | ||
*/ | ||
constructor(attributes?: MaterialShaderAttribute[]); | ||
/** | ||
* Creates a shader used to render a mesh. | ||
@@ -63,9 +43,4 @@ * @param mesh Mesh to use. | ||
abstract updateUniforms?(mesh: Mesh3D, shader: PIXI.Shader): void; | ||
addGeometryAttributes(geometry: MeshGeometry): void; | ||
/** | ||
* Creates geometry used to render a mesh. Will use the predefined shader | ||
* attributes if those have been set. | ||
* @param data Data used for creating the geometry. | ||
*/ | ||
createGeometry(data: MeshVertexData): PIXI.Geometry; | ||
/** | ||
* Renders the specified mesh. | ||
@@ -72,0 +47,0 @@ * @param mesh Mesh to render. |
import * as PIXI from "pixi.js"; | ||
import { Material, MaterialFactory } from "../material"; | ||
import { Container3D } from "../container"; | ||
import { MeshVertexData } from "./mesh-vertex"; | ||
import { MeshGeometry } from "./mesh-geometry"; | ||
export declare class Mesh3D extends Container3D { | ||
vertexData: MeshVertexData; | ||
geometry: MeshGeometry; | ||
material: Material; | ||
weights?: number[] | undefined; | ||
pluginName: string; | ||
constructor(vertexData: MeshVertexData, material: Material, weights?: number[] | undefined); | ||
constructor(geometry: MeshGeometry, material: Material); | ||
_render(renderer: PIXI.Renderer): void; | ||
isInteractive(object?: PIXI.DisplayObject): boolean; | ||
static createTorus(materialFactory?: MaterialFactory): Mesh3D; | ||
static createCube(materialFactory?: MaterialFactory): Mesh3D; | ||
static createSphere(materialFactory?: MaterialFactory): Mesh3D; | ||
} |
import * as PIXI from "pixi.js"; | ||
import { Material } from "../material"; | ||
import { MeshVertexData } from "../mesh/mesh-vertex"; | ||
import { LightingEnvironment } from "../lighting/lighting-environment"; | ||
import { Mesh3D } from "../mesh/mesh"; | ||
import { MeshGeometry } from "../mesh/mesh-geometry"; | ||
export declare enum PhysicallyBasedMaterialAlphaMode { | ||
@@ -25,2 +25,3 @@ opaque = "opaque", | ||
alphaMode: PhysicallyBasedMaterialAlphaMode; | ||
get name(): string; | ||
get lighting(): LightingEnvironment; | ||
@@ -31,7 +32,7 @@ get valid(): boolean; | ||
static create(source: unknown): PhysicallyBasedMaterial; | ||
createGeometry(data: MeshVertexData): PIXI.Geometry; | ||
addGeometryAttributes(geometry: MeshGeometry): void; | ||
createShader(mesh: Mesh3D, renderer: PIXI.Renderer): PIXI.Shader; | ||
createFeatures(vertexData: MeshVertexData): string[]; | ||
createFeatures(vertexData: MeshGeometry): string[]; | ||
updateUniforms(mesh: Mesh3D, shader: PIXI.Shader): void; | ||
render(mesh: Mesh3D, renderer: PIXI.Renderer): void; | ||
} |
import * as PIXI from "pixi.js"; | ||
import { Mesh3D } from "../mesh/mesh"; | ||
import { Material, MaterialFactory } from "../material"; | ||
import { CubeMipMapTexture } from "../cubemap/cube-mipmap"; | ||
export declare class SkyboxMaterialFactory implements MaterialFactory { | ||
texture: PIXI.CubeTexture; | ||
constructor(texture: PIXI.CubeTexture); | ||
texture: CubeMipMapTexture; | ||
constructor(texture: CubeMipMapTexture); | ||
create(): Material; | ||
} | ||
export declare class SkyboxMaterial extends Material { | ||
texture: PIXI.CubeTexture; | ||
texture: CubeMipMapTexture; | ||
private _valid; | ||
constructor(texture: PIXI.CubeTexture); | ||
constructor(texture: CubeMipMapTexture); | ||
get valid(): boolean; | ||
@@ -14,0 +15,0 @@ updateUniforms(mesh: Mesh3D, shader: PIXI.Shader): void; |
@@ -1,4 +0,4 @@ | ||
import * as PIXI from "pixi.js"; | ||
import { Mesh3D } from "../mesh/mesh"; | ||
import { Container3D } from "../container"; | ||
import { CubeMipMapTexture } from "../cubemap/cube-mipmap"; | ||
/** | ||
@@ -9,3 +9,3 @@ * A skybox is a method of creating backgrounds in a 3D scene. It consists of | ||
export declare class Skybox extends Container3D { | ||
texture: PIXI.CubeTexture; | ||
texture: CubeMipMapTexture; | ||
/** Cube mesh used to render the skybox. */ | ||
@@ -17,3 +17,3 @@ mesh: Mesh3D; | ||
*/ | ||
constructor(texture: PIXI.CubeTexture); | ||
constructor(texture: CubeMipMapTexture); | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
14
386062
1008