|
@@ -1,4 +1,43 @@
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class Tri2DInfo {
|
|
|
|
+ /**
|
|
|
|
+ * Construct an instance of Tri2DInfo, you can either pass null to a, b and c and the instance will be allocated "clear", or give actual triangle info and the center/radius will be computed
|
|
|
|
+ */
|
|
|
|
+ constructor(a: Vector2, b: Vector2, c: Vector2);
|
|
|
|
+ a: Vector2;
|
|
|
|
+ b: Vector2;
|
|
|
|
+ c: Vector2;
|
|
|
|
+ center: Vector2;
|
|
|
|
+ radius: number;
|
|
|
|
+ static Zero(): Tri2DInfo;
|
|
|
|
+ set(a: Vector2, b: Vector2, c: Vector2): void;
|
|
|
|
+ transformInPlace(transform: Matrix): void;
|
|
|
|
+ doesContain(p: Vector2): boolean;
|
|
|
|
+ private _updateCenterRadius();
|
|
|
|
+ }
|
|
|
|
+ class Tri2DArray {
|
|
|
|
+ constructor(count: number);
|
|
|
|
+ clear(count: number): void;
|
|
|
|
+ storeTriangle(index: number, a: Vector2, b: Vector2, c: Vector2): void;
|
|
|
|
+ /**
|
|
|
|
+ * Store a triangle in a Tri2DInfo object
|
|
|
|
+ * @param index the index of the triangle to store
|
|
|
|
+ * @param tri2dInfo the instance that will contain the data, it must be already allocated with its inner object also allocated
|
|
|
|
+ */
|
|
|
|
+ storeToTri2DInfo(index: number, tri2dInfo: Tri2DInfo): void;
|
|
|
|
+ transformAndStoreToTri2DInfo(index: number, tri2dInfo: Tri2DInfo, transform: Matrix): void;
|
|
|
|
+ readonly count: number;
|
|
|
|
+ doesContain(p: Vector2): boolean;
|
|
|
|
+ static doesIntersect(setA: Tri2DArray, setB: Tri2DArray, bToATransform: Matrix): boolean;
|
|
|
|
+ private static _checkInitStatics();
|
|
|
|
+ private _count;
|
|
|
|
+ private _array;
|
|
|
|
+ private static tempV;
|
|
|
|
+ private static tempT;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class PropertyChangedInfo {
|
|
class PropertyChangedInfo {
|
|
/**
|
|
/**
|
|
* Previous value of the property
|
|
* Previous value of the property
|
|
@@ -719,6 +758,7 @@ declare module BABYLON {
|
|
* @return a new instance containing the result of the union
|
|
* @return a new instance containing the result of the union
|
|
*/
|
|
*/
|
|
union(other: BoundingInfo2D): BoundingInfo2D;
|
|
union(other: BoundingInfo2D): BoundingInfo2D;
|
|
|
|
+ worldAABBIntersectionTest(other: BoundingInfo2D): boolean;
|
|
private static _transform;
|
|
private static _transform;
|
|
/**
|
|
/**
|
|
* Transform this BoundingInfo2D with a given matrix and store the result in an existing BoundingInfo2D instance.
|
|
* Transform this BoundingInfo2D with a given matrix and store the result in an existing BoundingInfo2D instance.
|
|
@@ -727,6 +767,15 @@ declare module BABYLON {
|
|
* @param result A VALID (i.e. allocated) BoundingInfo2D object where the result will be stored
|
|
* @param result A VALID (i.e. allocated) BoundingInfo2D object where the result will be stored
|
|
*/
|
|
*/
|
|
transformToRef(matrix: Matrix, result: BoundingInfo2D): void;
|
|
transformToRef(matrix: Matrix, result: BoundingInfo2D): void;
|
|
|
|
+ private _updateWorldAABB(worldMatrix);
|
|
|
|
+ worldMatrixAccess: () => Matrix;
|
|
|
|
+ readonly worldAABBDirtyObservable: Observable<BoundingInfo2D>;
|
|
|
|
+ readonly isWorldAABBDirty: boolean;
|
|
|
|
+ dirtyWorldAABB(): void;
|
|
|
|
+ /**
|
|
|
|
+ * Retrieve the world AABB, the Vector4's data is x=xmin, y=ymin, z=xmax, w=ymax
|
|
|
|
+ */
|
|
|
|
+ readonly worldAABB: Vector4;
|
|
/**
|
|
/**
|
|
* Compute the union of this BoundingInfo2D with another one and store the result in a third valid BoundingInfo2D object
|
|
* Compute the union of this BoundingInfo2D with another one and store the result in a third valid BoundingInfo2D object
|
|
* This is a GC friendly version, try to use it as much as possible, specially if your transformation is inside a loop, allocate the result object once for good outside of the loop and use it every time.
|
|
* This is a GC friendly version, try to use it as much as possible, specially if your transformation is inside a loop, allocate the result object once for good outside of the loop and use it every time.
|
|
@@ -741,10 +790,89 @@ declare module BABYLON {
|
|
* @return true if the point is inside, false otherwise
|
|
* @return true if the point is inside, false otherwise
|
|
*/
|
|
*/
|
|
doesIntersect(pickPosition: Vector2): boolean;
|
|
doesIntersect(pickPosition: Vector2): boolean;
|
|
|
|
+ private _worldAABBDirtyObservable;
|
|
|
|
+ private _worldAABBDirty;
|
|
|
|
+ private _worldAABB;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ /**
|
|
|
|
+ * The base class for all implementation of a Primitive Collision Manager
|
|
|
|
+ */
|
|
|
|
+ abstract class PrimitiveCollisionManagerBase {
|
|
|
|
+ constructor(owner: Canvas2D);
|
|
|
|
+ abstract _addActor(actor: Prim2DBase, deep: boolean): ActorInfoBase;
|
|
|
|
+ abstract _removeActor(actor: Prim2DBase): any;
|
|
|
|
+ abstract _update(): any;
|
|
|
|
+ /**
|
|
|
|
+ * If collisionManagerUseBorders is true during the Canvas creation, this dictionary contains all the primitives intersecting with the left border
|
|
|
|
+ */
|
|
|
|
+ readonly abstract leftBorderIntersectedActors: ObservableStringDictionary<Prim2DBase>;
|
|
|
|
+ /**
|
|
|
|
+ * If collisionManagerUseBorders is true during the Canvas creation, this dictionary contains all the primitives intersecting with the bottom border
|
|
|
|
+ */
|
|
|
|
+ readonly abstract bottomBorderIntersectedActors: ObservableStringDictionary<Prim2DBase>;
|
|
|
|
+ /**
|
|
|
|
+ * If collisionManagerUseBorders is true during the Canvas creation, this dictionary contains all the primitives intersecting with the right border
|
|
|
|
+ */
|
|
|
|
+ readonly abstract rightBorderIntersectedActors: ObservableStringDictionary<Prim2DBase>;
|
|
|
|
+ /**
|
|
|
|
+ * If collisionManagerUseBorders is true during the Canvas creation, this dictionary contains all the primitives intersecting with the top border
|
|
|
|
+ */
|
|
|
|
+ readonly abstract topBorderIntersectedActors: ObservableStringDictionary<Prim2DBase>;
|
|
|
|
+ /**
|
|
|
|
+ * This dictionary contains all the couple of intersecting primitives
|
|
|
|
+ */
|
|
|
|
+ readonly abstract intersectedActors: ObservableStringDictionary<{
|
|
|
|
+ a: Prim2DBase;
|
|
|
|
+ b: Prim2DBase;
|
|
|
|
+ }>;
|
|
|
|
+ /**
|
|
|
|
+ * Renders the World AABB of all Actors
|
|
|
|
+ */
|
|
|
|
+ abstract debugRenderAABB: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Renders the area of the Clusters
|
|
|
|
+ */
|
|
|
|
+ abstract debugRenderClusters: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Display stats about the PCM on screen
|
|
|
|
+ */
|
|
|
|
+ abstract debugStats: boolean;
|
|
|
|
+ static allocBasicPCM(owner: Canvas2D, enableBorders: boolean): PrimitiveCollisionManagerBase;
|
|
|
|
+ protected _owner: Canvas2D;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Base class of an Actor
|
|
|
|
+ */
|
|
|
|
+ abstract class ActorInfoBase {
|
|
|
|
+ /**
|
|
|
|
+ * Access the World AABB of the Actor, the vector4 is x:left, y: bottom, z: right, w: top
|
|
|
|
+ */
|
|
|
|
+ readonly abstract worldAABB: Vector4;
|
|
|
|
+ /**
|
|
|
|
+ * Return true if the actor is enable, false otherwise
|
|
|
|
+ */
|
|
|
|
+ readonly abstract isEnabled: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Return true is the actor boundingInfo is use, false if its levelBoundingInfo is used.
|
|
|
|
+ */
|
|
|
|
+ readonly abstract isDeep: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Return the primitive of the actor
|
|
|
|
+ */
|
|
|
|
+ readonly abstract prim: Prim2DBase;
|
|
|
|
+ /**
|
|
|
|
+ * Return a dictionary containing all the actors intersecting with this one
|
|
|
|
+ */
|
|
|
|
+ readonly abstract intersectWith: ObservableStringDictionary<ActorInfoBase>;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ interface ILayoutData {
|
|
|
|
+ }
|
|
class LayoutEngineBase implements ILockable {
|
|
class LayoutEngineBase implements ILockable {
|
|
constructor();
|
|
constructor();
|
|
updateLayout(prim: Prim2DBase): void;
|
|
updateLayout(prim: Prim2DBase): void;
|
|
@@ -755,7 +883,9 @@ declare module BABYLON {
|
|
private _isLocked;
|
|
private _isLocked;
|
|
}
|
|
}
|
|
class CanvasLayoutEngine extends LayoutEngineBase {
|
|
class CanvasLayoutEngine extends LayoutEngineBase {
|
|
- static Singleton: CanvasLayoutEngine;
|
|
|
|
|
|
+ private static _singleton;
|
|
|
|
+ static readonly Singleton: CanvasLayoutEngine;
|
|
|
|
+ constructor();
|
|
updateLayout(prim: Prim2DBase): void;
|
|
updateLayout(prim: Prim2DBase): void;
|
|
private _doUpdate(prim);
|
|
private _doUpdate(prim);
|
|
readonly isChildPositionAllowed: boolean;
|
|
readonly isChildPositionAllowed: boolean;
|
|
@@ -773,6 +903,59 @@ declare module BABYLON {
|
|
updateLayout(prim: Prim2DBase): void;
|
|
updateLayout(prim: Prim2DBase): void;
|
|
readonly isChildPositionAllowed: boolean;
|
|
readonly isChildPositionAllowed: boolean;
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * GridData is used specify what row(s) and column(s) a primitive is placed in when its parent is using a Grid Panel Layout.
|
|
|
|
+ */
|
|
|
|
+ class GridData implements ILayoutData {
|
|
|
|
+ /**
|
|
|
|
+ * the row number of the grid
|
|
|
|
+ **/
|
|
|
|
+ row: number;
|
|
|
|
+ /**
|
|
|
|
+ * the column number of the grid
|
|
|
|
+ **/
|
|
|
|
+ column: number;
|
|
|
|
+ /**
|
|
|
|
+ * the number of rows a primitive will occupy
|
|
|
|
+ **/
|
|
|
|
+ rowSpan: number;
|
|
|
|
+ /**
|
|
|
|
+ * the number of columns a primitive will occupy
|
|
|
|
+ **/
|
|
|
|
+ columnSpan: number;
|
|
|
|
+ /**
|
|
|
|
+ * Create a Grid Data that describes where a primitive will be placed in a Grid Panel Layout.
|
|
|
|
+ * @param row the row number of the grid
|
|
|
|
+ * @param column the column number of the grid
|
|
|
|
+ * @param rowSpan the number of rows a primitive will occupy
|
|
|
|
+ * @param columnSpan the number of columns a primitive will occupy
|
|
|
|
+ **/
|
|
|
|
+ constructor(row: number, column: number, rowSpan?: number, columnSpan?: number);
|
|
|
|
+ }
|
|
|
|
+ class GridPanelLayoutEngine extends LayoutEngineBase {
|
|
|
|
+ constructor(settings: {
|
|
|
|
+ rows: [{
|
|
|
|
+ height: string;
|
|
|
|
+ }];
|
|
|
|
+ columns: [{
|
|
|
|
+ width: string;
|
|
|
|
+ }];
|
|
|
|
+ });
|
|
|
|
+ private _rows;
|
|
|
|
+ private _columns;
|
|
|
|
+ private _children;
|
|
|
|
+ private _rowBottoms;
|
|
|
|
+ private _columnLefts;
|
|
|
|
+ private _rowHeights;
|
|
|
|
+ private _columnWidths;
|
|
|
|
+ private static dstOffset;
|
|
|
|
+ private static dstArea;
|
|
|
|
+ updateLayout(prim: Prim2DBase): void;
|
|
|
|
+ readonly isChildPositionAllowed: boolean;
|
|
|
|
+ private _getMaxChildHeightInRow(rowNum);
|
|
|
|
+ private _getMaxChildWidthInColumn(colNum);
|
|
|
|
+ private _updateGrid(prim);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
@@ -1125,6 +1308,10 @@ declare module BABYLON {
|
|
*/
|
|
*/
|
|
animations: Animation[];
|
|
animations: Animation[];
|
|
/**
|
|
/**
|
|
|
|
+ * return a unique identifier for the Canvas2D
|
|
|
|
+ */
|
|
|
|
+ readonly uid: string;
|
|
|
|
+ /**
|
|
* Returns as a new array populated with the Animatable used by the primitive. Must be overloaded by derived primitives.
|
|
* Returns as a new array populated with the Animatable used by the primitive. Must be overloaded by derived primitives.
|
|
* Look at Sprite2D for more information
|
|
* Look at Sprite2D for more information
|
|
*/
|
|
*/
|
|
@@ -1214,6 +1401,9 @@ declare module BABYLON {
|
|
static flagDontInheritParentScale: number;
|
|
static flagDontInheritParentScale: number;
|
|
static flagGlobalTransformDirty: number;
|
|
static flagGlobalTransformDirty: number;
|
|
static flagLayoutBoundingInfoDirty: number;
|
|
static flagLayoutBoundingInfoDirty: number;
|
|
|
|
+ static flagCollisionActor: number;
|
|
|
|
+ static flagModelUpdate: number;
|
|
|
|
+ private _uid;
|
|
private _flags;
|
|
private _flags;
|
|
private _modelKey;
|
|
private _modelKey;
|
|
protected _levelBoundingInfo: BoundingInfo2D;
|
|
protected _levelBoundingInfo: BoundingInfo2D;
|
|
@@ -1641,7 +1831,7 @@ declare module BABYLON {
|
|
* @param dstOffset the position of the content, x, y, z, w are left, bottom, right, top
|
|
* @param dstOffset the position of the content, x, y, z, w are left, bottom, right, top
|
|
* @param dstArea the new size of the content
|
|
* @param dstArea the new size of the content
|
|
*/
|
|
*/
|
|
- computeWithAlignment(sourceArea: Size, contentSize: Size, alignment: PrimitiveAlignment, dstOffset: Vector4, dstArea: Size, computeLayoutArea?: boolean): void;
|
|
|
|
|
|
+ computeWithAlignment(sourceArea: Size, contentSize: Size, alignment: PrimitiveAlignment, contentScale: Vector2, dstOffset: Vector4, dstArea: Size, computeLayoutArea?: boolean): void;
|
|
/**
|
|
/**
|
|
* Compute an area and its position considering this thickness properties based on a given source area
|
|
* Compute an area and its position considering this thickness properties based on a given source area
|
|
* @param sourceArea the source area
|
|
* @param sourceArea the source area
|
|
@@ -1714,6 +1904,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -1728,6 +1921,16 @@ declare module BABYLON {
|
|
paddingBottom?: number | string;
|
|
paddingBottom?: number | string;
|
|
padding?: string;
|
|
padding?: string;
|
|
});
|
|
});
|
|
|
|
+ /**
|
|
|
|
+ * Return the ChangedDictionary observable of the StringDictionary containing the primitives intersecting with this one
|
|
|
|
+ */
|
|
|
|
+ readonly intersectWithObservable: Observable<DictionaryChanged<ActorInfoBase>>;
|
|
|
|
+ /**
|
|
|
|
+ * Return the ObservableStringDictionary containing all the primitives intersecting with this one.
|
|
|
|
+ * The key is the primitive uid, the value is the ActorInfo object
|
|
|
|
+ * @returns {}
|
|
|
|
+ */
|
|
|
|
+ readonly intersectWith: ObservableStringDictionary<ActorInfoBase>;
|
|
readonly actionManager: ActionManager;
|
|
readonly actionManager: ActionManager;
|
|
/**
|
|
/**
|
|
* From 'this' primitive, traverse up (from parent to parent) until the given predicate is true
|
|
* From 'this' primitive, traverse up (from parent to parent) until the given predicate is true
|
|
@@ -2069,6 +2272,7 @@ declare module BABYLON {
|
|
readonly pointerEventObservable: Observable<PrimitivePointerInfo>;
|
|
readonly pointerEventObservable: Observable<PrimitivePointerInfo>;
|
|
readonly zActualOrderChangedObservable: Observable<number>;
|
|
readonly zActualOrderChangedObservable: Observable<number>;
|
|
displayDebugAreas: boolean;
|
|
displayDebugAreas: boolean;
|
|
|
|
+ private static _updatingDebugArea;
|
|
private _updateDebugArea();
|
|
private _updateDebugArea();
|
|
findById(id: string): Prim2DBase;
|
|
findById(id: string): Prim2DBase;
|
|
protected onZOrderChanged(): void;
|
|
protected onZOrderChanged(): void;
|
|
@@ -2084,12 +2288,15 @@ declare module BABYLON {
|
|
* @param pointerId the Id of the pointer to release the capture from.
|
|
* @param pointerId the Id of the pointer to release the capture from.
|
|
*/
|
|
*/
|
|
releasePointerEventsCapture(pointerId: number): boolean;
|
|
releasePointerEventsCapture(pointerId: number): boolean;
|
|
|
|
+ private static _bypassGroup2DExclusion;
|
|
/**
|
|
/**
|
|
* Make an intersection test with the primitive, all inputs/outputs are stored in the IntersectInfo2D class, see its documentation for more information.
|
|
* Make an intersection test with the primitive, all inputs/outputs are stored in the IntersectInfo2D class, see its documentation for more information.
|
|
* @param intersectInfo contains the settings of the intersection to perform, to setup before calling this method as well as the result, available after a call to this method.
|
|
* @param intersectInfo contains the settings of the intersection to perform, to setup before calling this method as well as the result, available after a call to this method.
|
|
*/
|
|
*/
|
|
- private static _bypassGroup2DExclusion;
|
|
|
|
intersect(intersectInfo: IntersectInfo2D): boolean;
|
|
intersect(intersectInfo: IntersectInfo2D): boolean;
|
|
|
|
+ intersectOtherPrim(other: Prim2DBase): boolean;
|
|
|
|
+ readonly triList: Tri2DArray;
|
|
|
|
+ protected updateTriArray(): void;
|
|
/**
|
|
/**
|
|
* Move a child object into a new position regarding its siblings to change its rendering order.
|
|
* Move a child object into a new position regarding its siblings to change its rendering order.
|
|
* You can also use the shortcut methods to move top/bottom: moveChildToTop, moveChildToBottom, moveToTop, moveToBottom.
|
|
* You can also use the shortcut methods to move top/bottom: moveChildToTop, moveChildToBottom, moveToTop, moveToBottom.
|
|
@@ -2177,6 +2384,10 @@ declare module BABYLON {
|
|
* @param newPrimSize the new size of the primitive. PLEASE ROUND THE values, we're talking about pixels and fraction of them are not our friends!
|
|
* @param newPrimSize the new size of the primitive. PLEASE ROUND THE values, we're talking about pixels and fraction of them are not our friends!
|
|
*/
|
|
*/
|
|
protected _getActualSizeFromContentToRef(primSize: Size, newPrimSize: Size): void;
|
|
protected _getActualSizeFromContentToRef(primSize: Size, newPrimSize: Size): void;
|
|
|
|
+ /**
|
|
|
|
+ * Get/set the layout data to use for this primitive.
|
|
|
|
+ */
|
|
|
|
+ layoutData: ILayoutData;
|
|
private _owner;
|
|
private _owner;
|
|
private _parent;
|
|
private _parent;
|
|
private _actionManager;
|
|
private _actionManager;
|
|
@@ -2210,6 +2421,7 @@ declare module BABYLON {
|
|
private _lastAutoSizeArea;
|
|
private _lastAutoSizeArea;
|
|
private _layoutAreaPos;
|
|
private _layoutAreaPos;
|
|
private _layoutArea;
|
|
private _layoutArea;
|
|
|
|
+ private _layoutData;
|
|
private _contentArea;
|
|
private _contentArea;
|
|
private _rotation;
|
|
private _rotation;
|
|
private _scale;
|
|
private _scale;
|
|
@@ -2219,12 +2431,15 @@ declare module BABYLON {
|
|
private _actualScale;
|
|
private _actualScale;
|
|
private _displayDebugAreas;
|
|
private _displayDebugAreas;
|
|
private _debugAreaGroup;
|
|
private _debugAreaGroup;
|
|
|
|
+ private _actorInfo;
|
|
protected _parentTransformStep: number;
|
|
protected _parentTransformStep: number;
|
|
protected _globalTransformStep: number;
|
|
protected _globalTransformStep: number;
|
|
protected _globalTransformProcessStep: number;
|
|
protected _globalTransformProcessStep: number;
|
|
protected _localTransform: Matrix;
|
|
protected _localTransform: Matrix;
|
|
protected _globalTransform: Matrix;
|
|
protected _globalTransform: Matrix;
|
|
protected _invGlobalTransform: Matrix;
|
|
protected _invGlobalTransform: Matrix;
|
|
|
|
+ protected _primTriArrayDirty: boolean;
|
|
|
|
+ protected _primTriArray: Tri2DArray;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2293,6 +2508,7 @@ declare module BABYLON {
|
|
readonly isDisposed: boolean;
|
|
readonly isDisposed: boolean;
|
|
addRef(): number;
|
|
addRef(): number;
|
|
readonly modelKey: string;
|
|
readonly modelKey: string;
|
|
|
|
+ updateModelRenderCache(prim: Prim2DBase): boolean;
|
|
/**
|
|
/**
|
|
* Render the model instances
|
|
* Render the model instances
|
|
* @param instanceInfo
|
|
* @param instanceInfo
|
|
@@ -2541,6 +2757,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -2567,6 +2786,7 @@ declare module BABYLON {
|
|
scaleY?: number;
|
|
scaleY?: number;
|
|
dontInheritParentScale?: boolean;
|
|
dontInheritParentScale?: boolean;
|
|
trackNode?: Node;
|
|
trackNode?: Node;
|
|
|
|
+ trackNodeOffset?: Vector3;
|
|
opacity?: number;
|
|
opacity?: number;
|
|
zOrder?: number;
|
|
zOrder?: number;
|
|
origin?: Vector2;
|
|
origin?: Vector2;
|
|
@@ -2579,6 +2799,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -2641,6 +2864,10 @@ declare module BABYLON {
|
|
* Get/set the Scene's Node that should be tracked, the group's position will follow the projected position of the Node.
|
|
* Get/set the Scene's Node that should be tracked, the group's position will follow the projected position of the Node.
|
|
*/
|
|
*/
|
|
trackedNode: Node;
|
|
trackedNode: Node;
|
|
|
|
+ /**
|
|
|
|
+ * Get/set the offset of the tracked node in the tracked node's local space.
|
|
|
|
+ */
|
|
|
|
+ trackedNodeOffset: Vector3;
|
|
protected levelIntersect(intersectInfo: IntersectInfo2D): boolean;
|
|
protected levelIntersect(intersectInfo: IntersectInfo2D): boolean;
|
|
protected updateLevelBoundingInfo(): boolean;
|
|
protected updateLevelBoundingInfo(): boolean;
|
|
protected _prepareGroupRender(context: PrepareRender2DContext): void;
|
|
protected _prepareGroupRender(context: PrepareRender2DContext): void;
|
|
@@ -2658,7 +2885,9 @@ declare module BABYLON {
|
|
protected static _unS: Vector2;
|
|
protected static _unS: Vector2;
|
|
protected handleGroupChanged(prop: Prim2DPropInfo): void;
|
|
protected handleGroupChanged(prop: Prim2DPropInfo): void;
|
|
private detectGroupStates();
|
|
private detectGroupStates();
|
|
|
|
+ readonly _cachedTexture: MapTexture;
|
|
private _trackedNode;
|
|
private _trackedNode;
|
|
|
|
+ private _trackedNodeOffset;
|
|
protected _isRenderableGroup: boolean;
|
|
protected _isRenderableGroup: boolean;
|
|
protected _isCachedGroup: boolean;
|
|
protected _isCachedGroup: boolean;
|
|
private _cacheGroupDirty;
|
|
private _cacheGroupDirty;
|
|
@@ -2699,6 +2928,178 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class WireFrame2DRenderCache extends ModelRenderCache {
|
|
|
|
+ effectsReady: boolean;
|
|
|
|
+ vb: WebGLBuffer;
|
|
|
|
+ vtxCount: number;
|
|
|
|
+ instancingAttributes: InstancingAttributeInfo[];
|
|
|
|
+ effect: Effect;
|
|
|
|
+ effectInstanced: Effect;
|
|
|
|
+ render(instanceInfo: GroupInstanceInfo, context: Render2DContext): boolean;
|
|
|
|
+ updateModelRenderCache(prim: Prim2DBase): boolean;
|
|
|
|
+ dispose(): boolean;
|
|
|
|
+ }
|
|
|
|
+ class WireFrameVertex2D {
|
|
|
|
+ x: number;
|
|
|
|
+ y: number;
|
|
|
|
+ r: number;
|
|
|
|
+ g: number;
|
|
|
|
+ b: number;
|
|
|
|
+ a: number;
|
|
|
|
+ constructor(p: Vector2, c?: Color4);
|
|
|
|
+ fromVector2(p: Vector2): void;
|
|
|
|
+ fromColor3(c: Color3): void;
|
|
|
|
+ fromColor4(c: Color4): void;
|
|
|
|
+ }
|
|
|
|
+ class WireFrameGroup2D {
|
|
|
|
+ /**
|
|
|
|
+ * Construct a WireFrameGroup2D object
|
|
|
|
+ * @param id a unique ID among the Groups added to a given WireFrame2D primitive, if you don't specify an id, a random one will be generated. The id is immutable.
|
|
|
|
+ * @param defaultColor specify the default color that will be used when a vertex is pushed, white will be used if not specified.
|
|
|
|
+ */
|
|
|
|
+ constructor(id?: string, defaultColor?: Color4);
|
|
|
|
+ readonly uid: string;
|
|
|
|
+ /**
|
|
|
|
+ * Retrieve the ID of the group
|
|
|
|
+ */
|
|
|
|
+ readonly id: string;
|
|
|
|
+ /**
|
|
|
|
+ * Push a vertex in the array of vertices.
|
|
|
|
+ * If you're previously called startLineStrip, the vertex will be pushed twice in order to describe the end of a line and the start of a new one.
|
|
|
|
+ * @param p Position of the vertex
|
|
|
|
+ * @param c Color of the vertex, if null the default color of the group will be used
|
|
|
|
+ */
|
|
|
|
+ pushVertex(p: Vector2, c?: Color4): void;
|
|
|
|
+ /**
|
|
|
|
+ * Start to store a Line Strip. The given vertex will be pushed in the array. The you have to call pushVertex to add subsequent vertices describing the strip and don't forget to call endLineStrip to close the strip!!!
|
|
|
|
+ * @param p Position of the vertex
|
|
|
|
+ * @param c Color of the vertex, if null the default color of the group will be used
|
|
|
|
+ */
|
|
|
|
+ startLineStrip(p: Vector2, c?: Color4): void;
|
|
|
|
+ /**
|
|
|
|
+ * Close the Strip by storing a last vertex
|
|
|
|
+ * @param p Position of the vertex
|
|
|
|
+ * @param c Color of the vertex, if null the default color of the group will be used
|
|
|
|
+ */
|
|
|
|
+ endLineStrip(p: Vector2, c?: Color4): void;
|
|
|
|
+ /**
|
|
|
|
+ * Access to the array of Vertices, you can manipulate its content but BEWARE of what you're doing!
|
|
|
|
+ */
|
|
|
|
+ readonly vertices: Array<WireFrameVertex2D>;
|
|
|
|
+ private _uid;
|
|
|
|
+ private _id;
|
|
|
|
+ private _defaultColor;
|
|
|
|
+ private _vertices;
|
|
|
|
+ private _buildingStrip;
|
|
|
|
+ }
|
|
|
|
+ class WireFrame2D extends RenderablePrim2D {
|
|
|
|
+ static WIREFRAME2D_MAINPARTID: number;
|
|
|
|
+ static wireFrameGroupsProperty: Prim2DPropInfo;
|
|
|
|
+ readonly wireFrameGroups: StringDictionary<WireFrameGroup2D>;
|
|
|
|
+ /**
|
|
|
|
+ * If you change the content of the wireFrameGroups you MUST call this method for the changes to be reflected during rendering
|
|
|
|
+ */
|
|
|
|
+ wireFrameGroupsDirty(): void;
|
|
|
|
+ size: Size;
|
|
|
|
+ actualSize: Size;
|
|
|
|
+ protected updateLevelBoundingInfo(): boolean;
|
|
|
|
+ protected levelIntersect(intersectInfo: IntersectInfo2D): boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Create an WireFrame 2D primitive
|
|
|
|
+ * @param wireFrameGroups an array of WireFrameGroup.
|
|
|
|
+ * @param settings a combination of settings, possible ones are
|
|
|
|
+ * - parent: the parent primitive/canvas, must be specified if the primitive is not constructed as a child of another one (i.e. as part of the children array setting)
|
|
|
|
+ * - children: an array of direct children
|
|
|
|
+ * - id a text identifier, for information purpose
|
|
|
|
+ * - position: the X & Y positions relative to its parent. Alternatively the x and y properties can be set. Default is [0;0]
|
|
|
|
+ * - rotation: the initial rotation (in radian) of the primitive. default is 0
|
|
|
|
+ * - scale: the initial scale of the primitive. default is 1. You can alternatively use scaleX &| scaleY to apply non uniform scale
|
|
|
|
+ * - size: the size of the sprite displayed in the canvas, if not specified the spriteSize will be used
|
|
|
|
+ * - dontInheritParentScale: if set the parent's scale won't be taken into consideration to compute the actualScale property
|
|
|
|
+ * - opacity: set the overall opacity of the primitive, 1 to be opaque (default), less than 1 to be transparent.
|
|
|
|
+ * - zOrder: override the zOrder with the specified value
|
|
|
|
+ * - origin: define the normalized origin point location, default [0.5;0.5]
|
|
|
|
+ * - alignToPixel: the rendered lines will be aligned to the rendering device' pixels
|
|
|
|
+ * - isVisible: true if the sprite must be visible, false for hidden. Default is true.
|
|
|
|
+ * - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
|
|
+ * - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
|
|
+ * - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
|
|
+ * - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - marginBottom: bottom margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - margin: top, left, right and bottom margin formatted as a single string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - marginHAlignment: one value of the PrimitiveAlignment type's static properties
|
|
|
|
+ * - marginVAlignment: one value of the PrimitiveAlignment type's static properties
|
|
|
|
+ * - marginAlignment: a string defining the alignment, see PrimitiveAlignment.fromString
|
|
|
|
+ * - paddingTop: top padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
|
|
+ * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString)
|
|
|
|
+ */
|
|
|
|
+ constructor(wireFrameGroups: Array<WireFrameGroup2D>, settings?: {
|
|
|
|
+ parent?: Prim2DBase;
|
|
|
|
+ children?: Array<Prim2DBase>;
|
|
|
|
+ id?: string;
|
|
|
|
+ position?: Vector2;
|
|
|
|
+ x?: number;
|
|
|
|
+ y?: number;
|
|
|
|
+ rotation?: number;
|
|
|
|
+ size?: Size;
|
|
|
|
+ scale?: number;
|
|
|
|
+ scaleX?: number;
|
|
|
|
+ scaleY?: number;
|
|
|
|
+ dontInheritParentScale?: boolean;
|
|
|
|
+ opacity?: number;
|
|
|
|
+ zOrder?: number;
|
|
|
|
+ origin?: Vector2;
|
|
|
|
+ alignToPixel?: boolean;
|
|
|
|
+ isVisible?: boolean;
|
|
|
|
+ isPickable?: boolean;
|
|
|
|
+ isContainer?: boolean;
|
|
|
|
+ childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
|
|
+ marginTop?: number | string;
|
|
|
|
+ marginLeft?: number | string;
|
|
|
|
+ marginRight?: number | string;
|
|
|
|
+ marginBottom?: number | string;
|
|
|
|
+ margin?: number | string;
|
|
|
|
+ marginHAlignment?: number;
|
|
|
|
+ marginVAlignment?: number;
|
|
|
|
+ marginAlignment?: string;
|
|
|
|
+ paddingTop?: number | string;
|
|
|
|
+ paddingLeft?: number | string;
|
|
|
|
+ paddingRight?: number | string;
|
|
|
|
+ paddingBottom?: number | string;
|
|
|
|
+ padding?: string;
|
|
|
|
+ });
|
|
|
|
+ /**
|
|
|
|
+ * Get/set if the sprite rendering should be aligned to the target rendering device pixel or not
|
|
|
|
+ */
|
|
|
|
+ alignToPixel: boolean;
|
|
|
|
+ protected createModelRenderCache(modelKey: string): ModelRenderCache;
|
|
|
|
+ protected setupModelRenderCache(modelRenderCache: ModelRenderCache): WireFrame2DRenderCache;
|
|
|
|
+ _updateVertexBuffer(mrc: WireFrame2DRenderCache): void;
|
|
|
|
+ protected refreshInstanceDataPart(part: InstanceDataBase): boolean;
|
|
|
|
+ private _computeMinMaxTrans();
|
|
|
|
+ protected createInstanceDataParts(): InstanceDataBase[];
|
|
|
|
+ private _vtxTransparent;
|
|
|
|
+ private _wireFrameGroups;
|
|
|
|
+ private _alignToPixel;
|
|
|
|
+ }
|
|
|
|
+ class WireFrame2DInstanceData extends InstanceDataBase {
|
|
|
|
+ constructor(partId: number);
|
|
|
|
+ properties: Vector3;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class Rectangle2DRenderCache extends ModelRenderCache {
|
|
class Rectangle2DRenderCache extends ModelRenderCache {
|
|
effectsReady: boolean;
|
|
effectsReady: boolean;
|
|
fillVB: WebGLBuffer;
|
|
fillVB: WebGLBuffer;
|
|
@@ -2755,6 +3156,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -2795,6 +3199,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -2811,6 +3218,7 @@ declare module BABYLON {
|
|
});
|
|
});
|
|
static roundSubdivisions: number;
|
|
static roundSubdivisions: number;
|
|
protected createModelRenderCache(modelKey: string): ModelRenderCache;
|
|
protected createModelRenderCache(modelKey: string): ModelRenderCache;
|
|
|
|
+ protected updateTriArray(): void;
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Rectangle2DRenderCache;
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Rectangle2DRenderCache;
|
|
protected _getInitialContentAreaToRef(primSize: Size, initialContentPosition: Vector4, initialContentArea: Size): void;
|
|
protected _getInitialContentAreaToRef(primSize: Size, initialContentPosition: Vector4, initialContentArea: Size): void;
|
|
protected _getActualSizeFromContentToRef(primSize: Size, newPrimSize: Size): void;
|
|
protected _getActualSizeFromContentToRef(primSize: Size, newPrimSize: Size): void;
|
|
@@ -2873,6 +3281,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -2913,6 +3324,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -2927,6 +3341,7 @@ declare module BABYLON {
|
|
paddingBottom?: number | string;
|
|
paddingBottom?: number | string;
|
|
padding?: string;
|
|
padding?: string;
|
|
});
|
|
});
|
|
|
|
+ protected updateTriArray(): void;
|
|
protected createModelRenderCache(modelKey: string): ModelRenderCache;
|
|
protected createModelRenderCache(modelKey: string): ModelRenderCache;
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Ellipse2DRenderCache;
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Ellipse2DRenderCache;
|
|
protected createInstanceDataParts(): InstanceDataBase[];
|
|
protected createInstanceDataParts(): InstanceDataBase[];
|
|
@@ -3003,6 +3418,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -3043,6 +3461,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -3355,6 +3776,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -3399,6 +3823,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -3546,6 +3973,9 @@ declare module BABYLON {
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
* - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
|
|
|
|
+ * - levelCollision: this primitive is an actor of the Collision Manager and only this level will be used for collision (i.e. not the children). Use deepCollision if you want collision detection on the primitives and its children.
|
|
|
|
+ * - deepCollision: this primitive is an actor of the Collision Manager, this level AND ALSO its children will be used for collision (note: you don't need to set the children as level/deepCollision).
|
|
|
|
+ * - layoutData: a instance of a class implementing the ILayoutData interface that contain data to pass to the primitive parent's layout engine
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
* - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
|
|
@@ -3586,6 +4016,9 @@ declare module BABYLON {
|
|
isPickable?: boolean;
|
|
isPickable?: boolean;
|
|
isContainer?: boolean;
|
|
isContainer?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
childrenFlatZOrder?: boolean;
|
|
|
|
+ levelCollision?: boolean;
|
|
|
|
+ deepCollision?: boolean;
|
|
|
|
+ layoutData?: ILayoutData;
|
|
marginTop?: number | string;
|
|
marginTop?: number | string;
|
|
marginLeft?: number | string;
|
|
marginLeft?: number | string;
|
|
marginRight?: number | string;
|
|
marginRight?: number | string;
|
|
@@ -3617,6 +4050,7 @@ declare module BABYLON {
|
|
private _buildCap(vb, vbi, ib, ibi, pos, thickness, borderThickness, type, capDir, contour);
|
|
private _buildCap(vb, vbi, ib, ibi, pos, thickness, borderThickness, type, capDir, contour);
|
|
private _buildLine(vb, contour, ht, bt?);
|
|
private _buildLine(vb, contour, ht, bt?);
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Lines2DRenderCache;
|
|
protected setupModelRenderCache(modelRenderCache: ModelRenderCache): Lines2DRenderCache;
|
|
|
|
+ protected updateTriArray(): void;
|
|
private _computeLines2D();
|
|
private _computeLines2D();
|
|
readonly size: Size;
|
|
readonly size: Size;
|
|
protected createInstanceDataParts(): InstanceDataBase[];
|
|
protected createInstanceDataParts(): InstanceDataBase[];
|
|
@@ -3636,11 +4070,6 @@ declare module BABYLON {
|
|
private _borderIB;
|
|
private _borderIB;
|
|
private _boundingMin;
|
|
private _boundingMin;
|
|
private _boundingMax;
|
|
private _boundingMax;
|
|
- private _contour;
|
|
|
|
- private _startCapContour;
|
|
|
|
- private _startCapTriIndices;
|
|
|
|
- private _endCapContour;
|
|
|
|
- private _endCapTriIndices;
|
|
|
|
private _closed;
|
|
private _closed;
|
|
private _startCap;
|
|
private _startCap;
|
|
private _endCap;
|
|
private _endCap;
|
|
@@ -3701,6 +4130,9 @@ declare module BABYLON {
|
|
isScreenSpace?: boolean;
|
|
isScreenSpace?: boolean;
|
|
cachingStrategy?: number;
|
|
cachingStrategy?: number;
|
|
enableInteraction?: boolean;
|
|
enableInteraction?: boolean;
|
|
|
|
+ enableCollisionManager?: boolean;
|
|
|
|
+ customCollisionManager?: (owner: Canvas2D, enableBorders: boolean) => PrimitiveCollisionManagerBase;
|
|
|
|
+ collisionManagerUseBorders?: boolean;
|
|
origin?: Vector2;
|
|
origin?: Vector2;
|
|
isVisible?: boolean;
|
|
isVisible?: boolean;
|
|
backgroundRoundRadius?: number;
|
|
backgroundRoundRadius?: number;
|
|
@@ -3721,6 +4153,7 @@ declare module BABYLON {
|
|
readonly updateGlobalTransformCounter: PerfCounter;
|
|
readonly updateGlobalTransformCounter: PerfCounter;
|
|
readonly boundingInfoRecomputeCounter: PerfCounter;
|
|
readonly boundingInfoRecomputeCounter: PerfCounter;
|
|
static readonly instances: Array<Canvas2D>;
|
|
static readonly instances: Array<Canvas2D>;
|
|
|
|
+ readonly primitiveCollisionManager: PrimitiveCollisionManagerBase;
|
|
protected _canvasPreInit(settings: any): void;
|
|
protected _canvasPreInit(settings: any): void;
|
|
static _zMinDelta: number;
|
|
static _zMinDelta: number;
|
|
private _setupInteraction(enable);
|
|
private _setupInteraction(enable);
|
|
@@ -3774,10 +4207,6 @@ declare module BABYLON {
|
|
*/
|
|
*/
|
|
readonly engine: Engine;
|
|
readonly engine: Engine;
|
|
/**
|
|
/**
|
|
- * return a unique identifier for the Canvas2D
|
|
|
|
- */
|
|
|
|
- readonly uid: string;
|
|
|
|
- /**
|
|
|
|
* And observable called during the Canvas rendering process.
|
|
* And observable called during the Canvas rendering process.
|
|
* This observable is called twice per render, each time with a different mask:
|
|
* This observable is called twice per render, each time with a different mask:
|
|
* - 1: before render is executed
|
|
* - 1: before render is executed
|
|
@@ -3832,6 +4261,7 @@ declare module BABYLON {
|
|
readonly fitRenderingDevice: boolean;
|
|
readonly fitRenderingDevice: boolean;
|
|
readonly designSize: Size;
|
|
readonly designSize: Size;
|
|
readonly designSizeUseHorizAxis: boolean;
|
|
readonly designSizeUseHorizAxis: boolean;
|
|
|
|
+ designSizeUseHorizeAxis: boolean;
|
|
/**
|
|
/**
|
|
* Return
|
|
* Return
|
|
*/
|
|
*/
|
|
@@ -3860,7 +4290,6 @@ declare module BABYLON {
|
|
addUpdatePositioningCounter(count: number): void;
|
|
addUpdatePositioningCounter(count: number): void;
|
|
addupdateLocalTransformCounter(count: number): void;
|
|
addupdateLocalTransformCounter(count: number): void;
|
|
addUpdateGlobalTransformCounter(count: number): void;
|
|
addUpdateGlobalTransformCounter(count: number): void;
|
|
- private _uid;
|
|
|
|
private _renderObservable;
|
|
private _renderObservable;
|
|
private __engineData;
|
|
private __engineData;
|
|
private _interactionEnabled;
|
|
private _interactionEnabled;
|
|
@@ -3901,6 +4330,7 @@ declare module BABYLON {
|
|
protected _maxAdaptiveWorldSpaceCanvasSize: number;
|
|
protected _maxAdaptiveWorldSpaceCanvasSize: number;
|
|
private _designSize;
|
|
private _designSize;
|
|
private _designUseHorizAxis;
|
|
private _designUseHorizAxis;
|
|
|
|
+ _primitiveCollisionManager: PrimitiveCollisionManagerBase;
|
|
_renderingSize: Size;
|
|
_renderingSize: Size;
|
|
private _drawCallsOpaqueCounter;
|
|
private _drawCallsOpaqueCounter;
|
|
private _drawCallsAlphaTestCounter;
|
|
private _drawCallsAlphaTestCounter;
|
|
@@ -4049,6 +4479,9 @@ declare module BABYLON {
|
|
padding?: string;
|
|
padding?: string;
|
|
});
|
|
});
|
|
dispose(): boolean;
|
|
dispose(): boolean;
|
|
|
|
+ trackNode: Node;
|
|
|
|
+ trackNodeOffset: Vector3;
|
|
|
|
+ trackNodeBillboard: boolean;
|
|
private _customWorldSpaceNode;
|
|
private _customWorldSpaceNode;
|
|
}
|
|
}
|
|
class ScreenSpaceCanvas2D extends Canvas2D {
|
|
class ScreenSpaceCanvas2D extends Canvas2D {
|
|
@@ -4103,6 +4536,9 @@ declare module BABYLON {
|
|
cachingStrategy?: number;
|
|
cachingStrategy?: number;
|
|
cacheBehavior?: number;
|
|
cacheBehavior?: number;
|
|
enableInteraction?: boolean;
|
|
enableInteraction?: boolean;
|
|
|
|
+ enableCollisionManager?: boolean;
|
|
|
|
+ customCollisionManager?: (owner: Canvas2D, enableBorders: boolean) => PrimitiveCollisionManagerBase;
|
|
|
|
+ collisionManagerUseBorders?: boolean;
|
|
isVisible?: boolean;
|
|
isVisible?: boolean;
|
|
backgroundRoundRadius?: number;
|
|
backgroundRoundRadius?: number;
|
|
backgroundFill?: IBrush2D | string;
|
|
backgroundFill?: IBrush2D | string;
|