Files
esengine/packages/world-streaming/src/components/StreamingAnchorComponent.ts

62 lines
1.5 KiB
TypeScript
Raw Normal View History

import { Component, ECSComponent, Serializable, Serialize, Property } from '@esengine/esengine';
/**
*
*
* Marks an entity as a streaming anchor point.
* Chunks are loaded/unloaded based on distance to anchors.
*
*
* /
*/
@ECSComponent('StreamingAnchor')
@Serializable({ version: 1, typeId: 'StreamingAnchor' })
export class StreamingAnchorComponent extends Component {
/**
*
*
* Weight multiplier for this anchor's load radius.
* Higher values mean larger load radius around this anchor.
*/
@Serialize()
@Property({ type: 'number', label: 'Weight', min: 0.1, max: 10 })
weight: number = 1.0;
/**
*
*
* Enable directional prefetching based on movement.
*/
@Serialize()
@Property({ type: 'boolean', label: 'Enable Prefetch' })
bEnablePrefetch: boolean = true;
/**
* X
*
* Previous frame X position for velocity calculation.
*/
previousX: number = 0;
/**
* Y
*
* Previous frame Y position for velocity calculation.
*/
previousY: number = 0;
/**
* X
*
* X component of velocity (units per second).
*/
velocityX: number = 0;
/**
* Y
*
* Y component of velocity (units per second).
*/
velocityY: number = 0;
}