0.2.4 • Published 2 years ago

@cve-ts/features v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

Offset

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
}
KeyDescriptionValueDefault
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, sizeY64, 64
IsFixedLabelWidth指示标签宽度是否固定booleanfalse
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
}
KeyDescriptionValue
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
}
KeyDescriptionValueDefault
AnimatePolyline 创建后的显示动画PolylineAnimate-
AnimateSpeed动画速度(米/秒)(0, n)-
AnimateDuration动画持续时间(0, n)-
Color颜色string of RGBA-
FlowSpeed流动速度(-n, n)-
InterpolationDistance浮于表面生成时的插值计算距离(米)(0, n)-
IsLoop是否首尾相连booleanfalse
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
}
KeyDescriptionValueDefault
AnimatePolyline 创建后的显示动画PolylineAnimate-
AnimateSpeed动画速度(米/秒)(0, n)-
AnimateDuration动画持续时间(0, n)-
Color颜色1string of RGBA-
Color2颜色2string of RGBA-
FlowSpeed流动速度(-n, n)-
InterpolationDistance浮于表面生成时的插值计算距离(米)(0, n)-
IsLoop是否首尾相连booleanfalse
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
}
KeyDescriptionValueDefault
AnimatePolyline 创建后的显示动画PolylineAnimate-
AnimateSpeed动画速度(米/秒)(0, n)-
AnimateDuration动画持续时间(0, n)-
Color颜色string of RGBA-
Direction指示 Polyline 是水平还是直立boolean-
InterpolationDistance浮于表面生成时的插值计算距离(米)(0, n)-
IsLoop是否首尾相连booleanfalse
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
}
KeyDescriptionValue
AnimatePolyline 创建后的显示动画PolylineAnimate
AnimateSpeed动画速度(米/秒)(0, n)
AnimateDuration动画持续时间(0, n)
Color颜色1string of RGBA
Color2颜色2string 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
}
KeyDescriptionValueDefault
AnimatePolyline 创建后的显示动画PolylineAnimate-
AnimateSpeed动画速度(米/秒)(0, n)-
AnimateDuration动画持续时间(0, n)-
Color颜色string of RGBA-
InterpolationDistance浮于表面生成时的插值计算距离(米)(0, n)-
IsLoop是否首尾相连booleanfalse
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
}
KeyDescriptionValue
Angle条纹角度(度)0, 360
Color颜色1string of RGBA
Color2颜色2string 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 时不动,负值时反方向流动
0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago