initial commit

This commit is contained in:
2026-03-16 13:53:01 +02:00
parent 631dc7df36
commit 81e6e0a7a2
23381 changed files with 8224173 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/**
* Abstract class for eye overlay and eye classes.
* @class AbstractEye
* @extends jibo.face.AbstractLayer
* @memberof jibo.face
* @param {Boolean} cache `true` to cache textures.
*/
/**
* The eye mesh.
* @name jibo.face.AbstractEye#eyeMesh
* @type {jibo.face.EyeMesh}
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractEye#init
* @param {PIXI.Texture} texture The default texture to use
*/
/**
* Destroy and don't use after this.
* @method jibo.face.AbstractEye#destroy
*/
/**
* Set current eye texture.
* @method jibo.face.AbstractEye#setTexture
* @protected
* @param {PIXI.Texture} texture Texture to set
*/

View File

@@ -0,0 +1,146 @@
/**
* Abstract class for background, eye overlay and eye classes.
* @class AbstractLayer
* @extends PIXI.Container
* @memberof jibo.face
* @param {Boolean} cache `true` to cache textures.
*/
/**
* If should update according to DOFValues.
* @name jibo.face.AbstractLayer#connected
* @type {String}
*/
/**
* `true` if layer has been initialized.
* @name jibo.face.AbstractLayer#initialized
* @type {String}
* @protected
*/
/**
* Current cached timestamp.
* @name jibo.face.AbstractLayer#timestamp
* @type {Number[]}
* @protected
*/
/**
* Current cached dofValues.
* @name jibo.face.AbstractLayer#dofValues
* @type {Number[]}
* @protected
*/
/**
* Empty placeholder texture.
* @name jibo.face.AbstractLayer#_defaultTexture
* @type {PIXI.Texture}
* @private
*/
/**
* Reference to the current texture.
* @name jibo.face.AbstractLayer#_texture
* @type {PIXI.Texture}
* @private
*/
/**
* Current path of the texture loaded/loading.
* @name jibo.face.AbstractLayer#_texturePath
* @type {String}
* @private
*/
/**
* The current asset loading
* @name jibo.face.AbstractLayer#_load
* @type {jibo.loader.AssetLoad}
* @private
*/
/**
* The cache key of the texture currently in use.
* @name jibo.face.AbstractLayer#_textureCacheKey
* @type {jibo.loader.AssetToken}
* @private
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractLayer#reset
* @param {Boolean} [resetPath=true] `false` to ignore resetting default path
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractLayer#init
* @param {PIXI.Texture} texture The default texture to use
*/
/**
* Display of DOFValues.
* @method jibo.face.AbstractLayer#display
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
* @return {Boolean} `true` proceeds with update.
*/
/**
* Full path to the texture to use.
* @name jibo.face.AbstractLayer#texturePath
* @type {String}
*/
/**
* Destroy and don't use after this.
* @method jibo.face.AbstractLayer#destroy
*/
/**
* Set current eye texture.
* @method jibo.face.AbstractLayer#setTexture
* @param {PIXI.Texture} texture Texture to set.
* @override
*/
/**
* Value to tint.
* @method jibo.face.AbstractLayer#rgb2hex
* @protected
* @param {Number} red Red value from 0 to 1
* @param {Number} green Green value from 0 to 1
* @param {Number} blue Blue value from 0 to 1
* @return {int} The resulting uint color
*/
/**
* Check to see a path matches the default texture.
* @method jibo.face.AbstractLayer#_isDefaultTexture
* @param {PIXI.Texture} texture The default texture.
* @param {String} value Full path to test.
* @return {Boolean} `true` if the value is the default texture.
* @private
*/
/**
* If there's a current load happen, stop it.
* @method jibo.face.AbstractLayer#_cancelLoad
* @private
*/
/**
* Set the current texture path.
* @method jibo.face.AbstractLayer#_applyTexture
* @param {String} value Path to the texture
* @private
*/
/**
* Set the current texture path.
* @method jibo.face.AbstractLayer#_loadTexture
* @param {String} value Path to the texture
* @private
*/

View File

@@ -0,0 +1,39 @@
/**
* Represents a background.
* @class Background
* @extends jibo.face.AbstractLayer
* @memberof jibo.face
* @param {Boolean} cache Cache the texture.
*/
/**
* The base sprite for holding the texture.
* @name jibo.face.Background#sprite
* @type {PIXI.Sprite}
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.Background#init
* @param {PIXI.Texture} texture The default texture to use
*/
/**
* Update of DOFValues.
* @method jibo.face.Background#display
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
*/
/**
* Override destroy
* @method jibo.face.Background#destroy
* @override
*/
/**
* Set current eye texture.
* @method jibo.face.Background#setTexture
* @protected
* @param {PIXI.Texture} texture Texture to set
*/

14
docs/rendering/eye/Eye.js Normal file
View File

@@ -0,0 +1,14 @@
/**
* Represents an eye.
* @class Eye
* @extends jibo.face.AbstractEye
* @memberof jibo.face
*/
/**
* Update of DOFValues.
* @method jibo.face.Eye#display
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
* @return {Boolean} `true` proceeds with update.
*/

View File

@@ -0,0 +1,155 @@
/**
* The representation of the eye.
* @class EyeContainer
* @memberof jibo.face
* @extends PIXI.Container
*/
/**
* Eye display.
* @name jibo.face.EyeContainer#eye
* @type {jibo.face.Eye}
*/
/**
* Eye overlay display.
* @name jibo.face.EyeContainer#eyeOverlay
* @type {jibo.face.EyeOverlay}
*/
/**
* The background border for debugging.
* @name jibo.face.EyeContainer#backgroundBorder
* @type {PIXI.Graphics}
*/
/**
* The background of eye.
* @name jibo.face.EyeContainer#background
* @type {jibo.face.Background}
*/
/**
* `true` if the eye is connected to the DOF values.
* @name jibo.face.EyeContainer#connected
* @type {Boolean}
*/
/**
* Glow Filter for eye display.
* Must enable with `jibo.face.eye.glow.enabled = true`
* @name jibo.face.EyeContainer#glow
* @type {jibo.face.GlowFilter}
*/
/**
* Lighting Filter for eye display.
* Must enable with `jibo.face.eye.lighting.enabled = true`
* @name jibo.face.EyeContainer#lighting
* @type {jibo.face.LightFilter}
*/
/**
* Adds a face animation to play.
* @method jibo.face#addAnimation
* @param {jibo.rendering.animation.KeysAnimation} anim The animation to play.
*/
/**
* Removes a face animation. It will be destroyed in the future (but soon) to avoid flickering
* between animations.
* @method jibo.face#removeAnimation
* @param {jibo.rendering.animation.KeysAnimation} anim The animation to remove - this should a playing animation.
*/
/**
* Holds the current face animation if it is scheduled for removal. It will be removed the next
* time that an animation is set.
* @method jibo.face#holdCurrentAnim
*/
/**
* Get a texture from the current loaded animation.
* @method jibo.face#getTexture
* @param {String} value Full path to the file to use.
* @return {PIXI.Texture} Texture from the animation.
*/
/**
* If the eye is active.
* @method jibo.face#active
* @type {boolean}
*/
/**
* Update the DOFValues for display.
* @private
* @method jibo.face.EyeContainer#display
* @param {Array<number>} timestamp Global timestamps in seconds and milliseconds.
* @param {jibo.face.DOFValues} dofValues Collection of animation values.
* @param {Object} [meta] Optional object for timeline timestamps.
*/
/**
* Changes the zoom level. Default is 1 = 100%.
* @method jibo.face.eyeContainer#zoom
* @type {number}
* @private
*/
/**
* Make a border around the screen.
* @method jibo.face.EyeContainer#makeBorder
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {String} dofValues Update display according to these values.
* @param {Object} meta
* @private
*/
/**
* Cleans up the renderer.
* @method jibo.face.EyeContainer#destroy
* @private
*/
/**
* Get the default texture names.
* @method jibo.face.EyeContainer#_getDefaultTextures
* @private
*/
/**
* Handle when the timeline needs to be reordered.
* @method jibo.face.EyeContainer#onAnimationReorder
* @private
*/
/**
* Handle when the animation stops.
* @method jibo.face.EyeContainer#onAnimationStopped
* @private
*/
/**
* Queues a face animation for removal.
* @method jibo.face#queueAnimRemoval
* @private
*/
/**
* Removes the current face animation, and sets up the pending one.
* @method jibo.face#swapLastAnimForPending
* @private
*/
/**
* Removes the current face animation, destroying it.
* @method jibo.face#removeLastAnim
* @private
*/
/**
* Removes the current face animation, destroying it and resetting the eye.
* @method jibo.face#removeLastAnimAndReset
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* The mesh of the eye.
* @class EyeMesh
* @extends PIXI.mesh.Mesh
* @memberof jibo.face
* @param {PIXI.Texture} texture
*/
/**
* The points for DOF transforms.
* @name jibo.face.EyeMesh#points
* @type {Array<PIXI.Point>}
*/

View File

@@ -0,0 +1,14 @@
/**
* Represents an eye overlay.
* @class EyeOverlay
* @extends jibo.face.AbstractEye
* @memberof jibo.face
*/
/**
* Update of DOFValues.
* @method jibo.face.EyeOverlay#display
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
* @return {Boolean} `true` proceeds with update.
*/

View File

@@ -0,0 +1,93 @@
/**
* Apply a glow and halo effect to a Display Object.
*
* @class GlowFilter
* @extends PIXI.Filter
* @memberof jibo.face
*/
/**
* Render the glow over the displayObject.
* Can use Add (recommended), or Screen.
* @name jibo.face.GlowFilter#blendMode
* @type {Number}
*/
/**
* Target that the glow centers on.
* @name jibo.face.GlowFilter#target
* @type {DisplayObject}
*/
/**
* Set the blur amount of the glow (increases size of glow).
*
* @name jibo.face.GlowFilter#blur
* @type {Number}
* @default 15
*/
/**
* Set the quality of the blur. High quality (10) will degrade performance.
* Low quality (1) will sacrifice quality for performance.
*
* @name jibo.face.GlowFilter#blurQuality
* @type {Number}
* @default 7
*/
/**
* Speed (in pixels per frame) halo moves outward at each update.
* Use negative values to animate in reverse.
* @name jibo.face.GlowFilter#haloSpeed
* @type {Number}
* @default 0
*/
/**
* Maximum distance (in pixels) that the halo can be away from the edges.
* @name jibo.face.GlowFilter#haloMaxDistance
* @type {Number}
* @default 80
*/
/**
* Set the distance of the halo from the glow from 0 to 1. 0 makes the halo touch the glow.
* 1 puts the halo haloMaxDistance from the edge of the glow.
* @name jibo.face.GlowFilter#halo
* @type {Number}
* @default 0
*/
/**
* Filter amount from 0 to 1.
* 0 to apply no lighting effect. 1 to make lighting effect fully visible.
* @name jibo.face.GlowFilter#amount
* @type {Number}
* @default 1.0
*/
/**
* Color of the glow in hexadecimal.
* eg 0xFF0000
* @type {Hexadecimal}
* @name jibo.face.GlowFilter#color
*/
/**
* Conversion utility to convert hex into alpha
* @method jibo.face.GlowFilter#hex2rgba
*/
/**
* Update of DOFValues.
* @method jibo.face.Eye#update
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {String} dofValues Update display according to these values.
*/
/**
* Update the halo animation.
* @private
* @method jibo.face.Eye#animate
*/

View File

@@ -0,0 +1,108 @@
/**
* Apply a light effect to a displayObject.
* Create a gradient scaled to match the dimensions of the object.
* Automatically adjust gradient position based on location of light effect.
*
* @class LightFilter
* @extends PIXI.Filter
* @memberof jibo.face
*/
/**
* Move the gradient center this distance in relation to the light source.
* The higher the value, the greater the effect of the light movement.
* @name jibo.face.LightFilter#radius
* @type {Number}
* @default 250
*/
/**
* Distance the gradient center will move based on the distance from the light source.
* The higher the values the greater the effect of the light movement.
* @name jibo.face.LightFilter#distanceMagnification
* @type {PIXI.Point}
*/
/**
* Position of the light source. For the best effect this should be set to be the center of the screen
* @name jibo.face.LightFilter#lightPosition
* @type {PIXI.Point}
*/
/**
* Target that the glow centers on.
* @name jibo.face.LightFilter#target
* @type {DisplayObject}
*/
/**
* Darkest (furthest) color of the light effect in hexadecimal numbers.
* i.e. 0xFF0000
* @type {Number}
* @default 0x5a5552
* @name jibo.face.LightFilter#dark
*/
/**
* Mid-color of the light effect in hexadecimal numbers.
* i.e. 0xFF0000
* @default 0xc0bab6
* @type {Number}
* @name jibo.face.LightFilter#mid
*/
/**
* Lightest (closest) color of the light effect in hexadecimal numbers.
* i.e. 0xFF0000
* @default 0xffffff
* @type {Number}
* @name jibo.face.LightFilter#light
*/
/**
* Amount of the light between 0 and 1 to (creates speaking light effect).
* Apply to darkest areas first. 0 = no extra brightness. 1 = full white.
* @default 1
* @type {Number}
* @name jibo.face.LightFilter#amount
*/
/**
* Brightness of the filter between 0 and 1.
* 0 = no lighting effect. 1 = full light effect visible.
* @default 1
* @type {Number}
* @name jibo.face.LightFilter#brightness
*/
/**
* Ratio of the midpoint of the gradient between 0 and 1.
* Lower value = mid color gradient sits closer to center of light gradient.
* Higher value = mid color gradient sits closer to outer dark part of gradient.
* @default 0.5
* @type {Number}
* @name jibo.face.LightFilter#gradientRatio
*/
/**
* Conversion utility to convert hex into alpha.
* @method jibo.face.LightFilter#hex2rgba
*/
/**
* Update the DOFValues for display.
* @private
* @method jibo.face.LightFilter#update
* @param {Array<number>} timestamp The timestamps.
* @param {jibo.face.DOFValues} dofValues
*/
/**
// * Convert R, G and B values to Uint
// * @method jibo.face.LightFilter#rgbToUint
// * @private
// * @param {Number} r Red value
// * @param {Number} g Green value
// * @param {Number} b Blue value
// * @return {Number} Uint of color.
// */