vec4<C extends Component> static method

ComponentField<C> vec4<C extends Component>(
  1. String name, {
  2. required Vector4 defaultValue(),
  3. Vector4 get(
    1. C component
    )?,
  4. void set(
    1. C component,
    2. Vector4 value
    )?,
  5. String? doc,
  6. String? group,
  7. List<String> formerNames = const [],
  8. bool transient = false,
})

A Vector4 property.

Implementation

static ComponentField<C> vec4<C extends Component>(
  String name, {
  required Vector4 Function() defaultValue,
  Vector4 Function(C component)? get,
  void Function(C component, Vector4 value)? set,
  String? doc,
  String? group,
  List<String> formerNames = const [],
  bool transient = false,
}) => ComponentField(
  ComponentPropertyDef(
    name,
    ComponentPropertyKind.vec4,
    defaultValue: Vec4Value(defaultValue()),
    doc: doc,
    group: group,
    formerNames: formerNames,
    transient: transient,
  ),
  read: get == null ? null : (c, _) => Vec4Value(get(c).clone()),
  write: set == null
      ? null
      : (c, v, _) {
          if (v is Vec4Value) set(c, v.value.clone());
        },
);