@cve-ts/features
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

CVE Features

This tool should help get you started developing with Geometry Features in UE5.

Base Feature | 基础要素

interface Feature {
  Coordinates: Coordinates | Coordinates[]
  IsHeightBasedSurface: boolean
  ID: string
  Name: string
  Offset: Offset
  Params: CustomParams
  Style: 'Custom'
  Tag: string
}

ID / Name / Tag

  • string
  • ID / 名称 / 标签

Coordinates

  • [longitude: number, latitude: number, altitude?: number]
  • 若未指定 altitude 值,则取默认值 0
  • 当未指定 altitude 值时,建议将参数 isHeightBasedSurface 设置为 true,并结合参数 offset 使用
  • 经纬度坐标

Offset

  • [x: number, y: number, z: number]
  • 基于坐标的偏移量(米),其中 z 值代表绘制的平面所处高度

IsHeightBasedSurface

  • boolean
  • 指示 Feature 生成时,其高度是否基于场景上表面
  • 若为 true,则高度为各点平面坐标处与场景上表面的交点加上 offset 参数的 z 值

Style

  • Custom
  • 不同要素 Style 不同,但都支持 Custom

Params

  • object
  • 不同 Style 对应的参数不同
interface CustomParams {
  Style: string
}

Point | 点

interface Point<S extends PointStyle> {
  Coordinates: Coordinates
  IsHeightBasedSurface: boolean
  ID: string
  Name: string
  Offset: Offset
  Params: PointParamsMap[S]
  Style: S
  Tag: string
}
type PointStyle = 'Custom' | 'Label01' | 'Label02' | 'Label03' | 'Marker01' | 'Marker02'

Label01 / Label02/ Label03

interface Label01Params {
  FadeEndDistance: number
  FadeStartDistance: number
  FontSize: number
  ImageBackgroundColor: string
  ImageNormal: string
  ImageSize: [sizeX: number, sizeY: number]
  TargetLength: number
}

interface Label02Params {
  FadeEndDistance: number
  FadeStartDistance: number
  FontSize: number
  ImageHover: string
  ImageNormal: string
  ImageSize: [sizeX: number, sizeY: number]
  TargetLength: number
}

interface Label03Params {
  FadeEndDistance: number
  FadeStartDistance: number
  FontSize: number
  ImageHover: string
  ImageNormal: string
  IsFixedLabelWidth: boolean
  LabelWidth: number
  TargetLength: number
}
Key Description Value Default
FadeEndDistance 图片结束淡化/消失的距离(米) [0, n) -
FadeStartDistance 图片开始淡化的距离(米) (0, n) -
FontSize 标签文字大小 (0, n) 24
ImageBackgroundColor 图标背景色 string of image -
ImageHover 处于 Hover 状态时的图标 string of image -
ImageNormal 默认图标 string of image -
ImageSize 图标大小 [sizeX, sizeY] [64, 64]
IsFixedLabelWidth 指示标签宽度是否固定 boolean false
LabelWidth 标签宽度 (0, n) 120
TargetLength 点击 POI 点后摄像机到 POI 点的距离(米) (0, n) -

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • Image 资源字符串模式1: 图片 url,字符串必须以“http”开头
  • Image 资源字符串模式2: 图片 base64 编码,字符串必须以“data:”开头
  • Image 资源字符串模式3: 约定好的虚幻引擎图片资源名称
  • Image 属性未设置,图标则为默认样式
  • IsFixedLabelWidth 为 true 时 LabelWidth 才生效
  • LabelWidth 默认值为 120

Marker01 / Marker02

interface Marker01Params {
  Color: string
  DurationPerBounce: number
  Emissive: number
  HeightPerBounce: number
  RotationPerSecond: number
}

interface Marker02Params {
  CircleAmount: number
  Color: string
  Duration: number
  Emissive: number
  Size: number
}
Key Description Value
CircleAmount 波纹个数 [0, n)
Color 颜色 string of RGBA
Duration 周期持续时间 (0, n)
DurationPerBounce 弹跳周期(秒) [0, n)
Emissive 自发光强度 (1, 100]
HeightPerBounce 弹跳高度(米) [0, n)
RotationPerSecond 每秒旋转度数(度) [0, n)
Size 直径大小(米) (0, n)

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'

Polyline | 线

interface Polyline<S extends PolylineStyle> {
  Coordinates: Coordinates[]
  IsHeightBasedSurface: boolean
  IsTraceSurface: boolean
  ID: string
  Name: string
  Offset: Offset
  Params: PolylineParamsMap[S]
  Style: T
  Tag: string
}
type PolylineAnimate = 'Immediately' | 'StartToEnd' | 'EndToStart' | 'MiddleToSide'
type PolylineDirection = 'Horizontal' | 'Vertical'
type PolylineStyle = 'Arrow01' | 'Custom' | 'Dash01' | 'Gradient01' | 'OD01' | 'OD02' | 'Solid01'

IsTraceSurface 说明:

  • boolean
  • 指示 Polyline 生成时,两点之间的连线是否沿着于地表
  • 若为 true,且 IsHeightBasedSurface 为 true,生成的线将以 offset 参数的 z 值高度紧贴地表
  • 插值间隔在 params 参数中的 InterpolationDistance 设置,默认为 1 米

Arrow01

interface Arrow01Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  FlowSpeed: number
  InterpolationDistance: number
  IsLoop: boolean
  Smoothness: number
  Width: number
}
Key Description Value Default
Animate Polyline 创建后的显示动画 PolylineAnimate -
AnimateSpeed 动画速度(米/秒) (0, n) -
AnimateDuration 动画持续时间 (0, n) -
Color 颜色 string of RGBA -
FlowSpeed 流动速度 (-n, n) -
InterpolationDistance 浮于表面生成时的插值计算距离(米) (0, n) -
IsLoop 是否首尾相连 boolean false
Smoothness 平滑度 (0, n) 100
Width 宽度(米) (0, n) -

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • FlowSpeed 为 0 时不动,负值时反方向流动
  • Smoothness 值越小 Polyline 越平滑,但性能越差

Dash01

interface Dash01Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  Color2: string
  FlowSpeed: number
  InterpolationDistance: number
  IsLoop: boolean
  Ratio: number
  Scale: number
  Smoothness: number
  Width: number
}
Key Description Value Default
Animate Polyline 创建后的显示动画 PolylineAnimate -
AnimateSpeed 动画速度(米/秒) (0, n) -
AnimateDuration 动画持续时间 (0, n) -
Color 颜色1 string of RGBA -
Color2 颜色2 string of RGBA -
FlowSpeed 流动速度 (-n, n) -
InterpolationDistance 浮于表面生成时的插值计算距离(米) (0, n) -
IsLoop 是否首尾相连 boolean false
Ratio 虚实比例 (0, n) -
Scale 度缩放系数/贴图缩放比例 (0, n) -
Smoothness 平滑度 (0, n) 100
Width 宽度(米) (0, n) -

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • FlowSpeed 为 0 时不动,负值时反方向流动
  • Smoothness 值越小 Polyline 越平滑,但性能越差

Gradient01

Gradient01Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  Direction: PolylineDirection
  InterpolationDistance: number
  IsLoop: boolean
  Smoothness: number
  Width: number
}
Key Description Value Default
Animate Polyline 创建后的显示动画 PolylineAnimate -
AnimateSpeed 动画速度(米/秒) (0, n) -
AnimateDuration 动画持续时间 (0, n) -
Color 颜色 string of RGBA -
Direction 指示 Polyline 是水平还是直立 boolean -
InterpolationDistance 浮于表面生成时的插值计算距离(米) (0, n) -
IsLoop 是否首尾相连 boolean false
Smoothness 平滑度 (0, n) 100
Width 宽度(米) (0, n) -

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • Smoothness 值越小 Polyline 越平滑,但性能越差

OD01 / OD02

interface OD01Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  Color2: string
  Curvature: number
}

interface OD02Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  Curvature: number
}
Key Description Value
Animate Polyline 创建后的显示动画 PolylineAnimate
AnimateSpeed 动画速度(米/秒) (0, n)
AnimateDuration 动画持续时间 (0, n)
Color 颜色1 string of RGBA
Color2 颜色2 string of RGBA
Curvature 曲率 (0, n)

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'

Solid01

interface Solid01Params {
  Animate: PolylineAnimate
  AnimateSpeed: number
  AnimateDuration: number
  Color: string
  InterpolationDistance: number
  IsLoop: boolean
  Smoothness: number
  Width: number
}
Key Description Value Default
Animate Polyline 创建后的显示动画 PolylineAnimate -
AnimateSpeed 动画速度(米/秒) (0, n) -
AnimateDuration 动画持续时间 (0, n) -
Color 颜色 string of RGBA -
InterpolationDistance 浮于表面生成时的插值计算距离(米) (0, n) -
IsLoop 是否首尾相连 boolean false
Smoothness 平滑度 (0, n) 100
Width 宽度(米) (0, n) -

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • Smoothness 值越小 Polyline 越平滑,但性能越差

Polygon | 面

interface Polygon<S extends PolylineStyle> {
  Coordinates: Coordinates[]
  IsHeightBasedSurface: boolean
  ID: string
  Name: string
  Offset: Offset
  Params: PolygonParamsMap[S]
  Style: S
  Tag: string
}
type PolygonStyle = 'Custom' | 'Solid01' | 'Stripe01'

Solid01

interface Solid01Params {
  Color: string
  Emissive: number
}

Stripe01

interface Stripe01Params {
  Angle: number
  Color: string
  Color2: string
  Emissive: number
  Ratio: number
  Scale: number
  Speed: number
}
Key Description Value
Angle 条纹角度(度) [0, 360]
Color 颜色1 string of RGBA
Color2 颜色2 string of RGBA
Emissive 自发光强度 (1, 100]
HeightPerBounce 条纹间线宽比例 (0, n)
RotationPerSecond 条纹宽度缩放系数 (0, n)
Size 流动速度 (-n, n)

补充说明:

  • Color 16进制 RGBA 值: '#FF0000FF'
  • Color 标准 RGBA 值: 'rgba(255,0,0,0.5)'
  • Speed 为 0 时不动,负值时反方向流动

Package Sidebar

Install

npm i @cve-ts/features

Weekly Downloads

1

Version

0.2.4

License

MIT

Unpacked Size

37.9 kB

Total Files

11

Last publish

Collaborators

  • sampung