Documentation ¶
Index ¶
- Variables
- type Axis
- type AxisDefinition
- func (d *AxisDefinition) WithLeftHubDefinition(def *HubDefinition) *AxisDefinition
- func (d *AxisDefinition) WithLeftWheelDefinition(def *WheelDefinition) *AxisDefinition
- func (d *AxisDefinition) WithMaxAcceleration(maxAcceleration float64) *AxisDefinition
- func (d *AxisDefinition) WithMaxBraking(maxBraking float64) *AxisDefinition
- func (d *AxisDefinition) WithMaxSteeringAngle(maxAngle dprec.Angle) *AxisDefinition
- func (d *AxisDefinition) WithPosition(position dprec.Vec3) *AxisDefinition
- func (d *AxisDefinition) WithReverseRatio(ratio float64) *AxisDefinition
- func (d *AxisDefinition) WithRightHubDefinition(def *HubDefinition) *AxisDefinition
- func (d *AxisDefinition) WithRightWheelDefinition(def *WheelDefinition) *AxisDefinition
- func (d *AxisDefinition) WithSpringDamping(damping float64) *AxisDefinition
- func (d *AxisDefinition) WithSpringFrequency(frequency float64) *AxisDefinition
- func (d *AxisDefinition) WithSpringLength(length float64) *AxisDefinition
- func (d *AxisDefinition) WithSuspensionLength(length float64) *AxisDefinition
- func (d *AxisDefinition) WithWidth(width float64) *AxisDefinition
- type Car
- type CarApplyInfo
- type CarComponent
- type CarDefinition
- type CarGamepadControl
- type CarGear
- type CarKeyboardControl
- type CarMouseControl
- type CarSystem
- type Chassis
- type ChassisDefinition
- func (d *ChassisDefinition) WithBeamLightNodeNames(names ...string) *ChassisDefinition
- func (d *ChassisDefinition) WithBodyDefinition(def *physics.BodyDefinition) *ChassisDefinition
- func (d *ChassisDefinition) WithHeadLightNodeNames(names ...string) *ChassisDefinition
- func (d *ChassisDefinition) WithNodeName(name string) *ChassisDefinition
- func (d *ChassisDefinition) WithStopLightNodeNames(names ...string) *ChassisDefinition
- func (d *ChassisDefinition) WithTailLightNodeNames(names ...string) *ChassisDefinition
- type ControlInput
- type ControlledComponent
- type FollowCameraComponent
- type FollowCameraSystem
- type GamepadProvider
- type Hub
- type HubDefinition
- type NodeComponent
- type Wheel
- type WheelDefinition
- type YawPitchCameraComponent
- type YawPitchCameraSystem
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CarComponentID = ecs.NewComponentTypeID() CarKeyboardControlID = ecs.NewComponentTypeID() CarMouseControlID = ecs.NewComponentTypeID() CarGamepadControlID = ecs.NewComponentTypeID() )
View Source
var ( NodeComponentID = ecs.NewComponentTypeID() ControlledComponentID = ecs.NewComponentTypeID() YawPitchCameraComponentID = ecs.NewComponentTypeID() FollowCameraComponentID = ecs.NewComponentTypeID() )
Functions ¶
This section is empty.
Types ¶
type Axis ¶
type Axis struct {
// contains filtered or unexported fields
}
func (*Axis) MaxAcceleration ¶
func (*Axis) MaxBraking ¶
func (*Axis) MaxSteeringAngle ¶
func (*Axis) ReverseRatio ¶
func (*Axis) RightWheel ¶
type AxisDefinition ¶
type AxisDefinition struct {
// contains filtered or unexported fields
}
func NewAxisDefinition ¶
func NewAxisDefinition() *AxisDefinition
func (*AxisDefinition) WithLeftHubDefinition ¶
func (d *AxisDefinition) WithLeftHubDefinition(def *HubDefinition) *AxisDefinition
func (*AxisDefinition) WithLeftWheelDefinition ¶
func (d *AxisDefinition) WithLeftWheelDefinition(def *WheelDefinition) *AxisDefinition
func (*AxisDefinition) WithMaxAcceleration ¶
func (d *AxisDefinition) WithMaxAcceleration(maxAcceleration float64) *AxisDefinition
func (*AxisDefinition) WithMaxBraking ¶
func (d *AxisDefinition) WithMaxBraking(maxBraking float64) *AxisDefinition
func (*AxisDefinition) WithMaxSteeringAngle ¶
func (d *AxisDefinition) WithMaxSteeringAngle(maxAngle dprec.Angle) *AxisDefinition
func (*AxisDefinition) WithPosition ¶
func (d *AxisDefinition) WithPosition(position dprec.Vec3) *AxisDefinition
func (*AxisDefinition) WithReverseRatio ¶
func (d *AxisDefinition) WithReverseRatio(ratio float64) *AxisDefinition
func (*AxisDefinition) WithRightHubDefinition ¶
func (d *AxisDefinition) WithRightHubDefinition(def *HubDefinition) *AxisDefinition
func (*AxisDefinition) WithRightWheelDefinition ¶
func (d *AxisDefinition) WithRightWheelDefinition(def *WheelDefinition) *AxisDefinition
func (*AxisDefinition) WithSpringDamping ¶
func (d *AxisDefinition) WithSpringDamping(damping float64) *AxisDefinition
func (*AxisDefinition) WithSpringFrequency ¶
func (d *AxisDefinition) WithSpringFrequency(frequency float64) *AxisDefinition
func (*AxisDefinition) WithSpringLength ¶
func (d *AxisDefinition) WithSpringLength(length float64) *AxisDefinition
func (*AxisDefinition) WithSuspensionLength ¶
func (d *AxisDefinition) WithSuspensionLength(length float64) *AxisDefinition
func (*AxisDefinition) WithWidth ¶
func (d *AxisDefinition) WithWidth(width float64) *AxisDefinition
type CarApplyInfo ¶
type CarComponent ¶
type CarComponent struct { Car *Car Gear CarGear SteeringAmount float64 Acceleration float64 Deceleration float64 Recover bool LightsOn bool }
func (*CarComponent) TypeID ¶
func (*CarComponent) TypeID() ecs.ComponentTypeID
type CarDefinition ¶
type CarDefinition struct {
// contains filtered or unexported fields
}
func NewCarDefinition ¶
func NewCarDefinition() *CarDefinition
func (*CarDefinition) ApplyToModel ¶
func (d *CarDefinition) ApplyToModel(scene *game.Scene, info CarApplyInfo) *Car
func (*CarDefinition) WithAxisDefinition ¶
func (d *CarDefinition) WithAxisDefinition(def *AxisDefinition) *CarDefinition
func (*CarDefinition) WithChassisDefinition ¶
func (d *CarDefinition) WithChassisDefinition(def *ChassisDefinition) *CarDefinition
type CarGamepadControl ¶
func (*CarGamepadControl) TypeID ¶
func (*CarGamepadControl) TypeID() ecs.ComponentTypeID
type CarKeyboardControl ¶
type CarKeyboardControl struct { AccelerateKey ui.KeyCode DecelerateKey ui.KeyCode TurnLeftKey ui.KeyCode TurnRightKey ui.KeyCode ShiftUpKey ui.KeyCode ShiftDownKey ui.KeyCode RecoverKey ui.KeyCode AccelerationChangeSpeed float64 DecelerationChangeSpeed float64 SteeringAmount float64 SteeringChangeSpeed float64 SteeringRestoreSpeed float64 }
func (*CarKeyboardControl) TypeID ¶
func (*CarKeyboardControl) TypeID() ecs.ComponentTypeID
type CarMouseControl ¶
type CarMouseControl struct { AccelerationChangeSpeed float64 DecelerationChangeSpeed float64 Destination dprec.Vec3 }
func (*CarMouseControl) TypeID ¶
func (*CarMouseControl) TypeID() ecs.ComponentTypeID
type CarSystem ¶
type CarSystem struct {
// contains filtered or unexported fields
}
func NewCarSystem ¶
func (*CarSystem) OnKeyboardEvent ¶
func (s *CarSystem) OnKeyboardEvent(event ui.KeyboardEvent) bool
func (*CarSystem) OnMouseEvent ¶
type Chassis ¶
type Chassis struct {
// contains filtered or unexported fields
}
func (*Chassis) BeamLights ¶
func (*Chassis) HeadLights ¶
func (c *Chassis) HeadLights() []*graphics.PointLight
func (*Chassis) StopLights ¶
func (c *Chassis) StopLights() []*graphics.PointLight
func (*Chassis) TailLights ¶
func (c *Chassis) TailLights() []*graphics.PointLight
type ChassisDefinition ¶
type ChassisDefinition struct {
// contains filtered or unexported fields
}
func NewChassisDefinition ¶
func NewChassisDefinition() *ChassisDefinition
func (*ChassisDefinition) WithBeamLightNodeNames ¶
func (d *ChassisDefinition) WithBeamLightNodeNames(names ...string) *ChassisDefinition
func (*ChassisDefinition) WithBodyDefinition ¶
func (d *ChassisDefinition) WithBodyDefinition(def *physics.BodyDefinition) *ChassisDefinition
func (*ChassisDefinition) WithHeadLightNodeNames ¶
func (d *ChassisDefinition) WithHeadLightNodeNames(names ...string) *ChassisDefinition
func (*ChassisDefinition) WithNodeName ¶
func (d *ChassisDefinition) WithNodeName(name string) *ChassisDefinition
func (*ChassisDefinition) WithStopLightNodeNames ¶
func (d *ChassisDefinition) WithStopLightNodeNames(names ...string) *ChassisDefinition
func (*ChassisDefinition) WithTailLightNodeNames ¶
func (d *ChassisDefinition) WithTailLightNodeNames(names ...string) *ChassisDefinition
type ControlInput ¶
type ControlInput int
const ( ControlInputKeyboard ControlInput = 1 << iota ControlInputMouse ControlInputGamepad0 )
func (ControlInput) Is ¶
func (i ControlInput) Is(query ControlInput) bool
type ControlledComponent ¶
type ControlledComponent struct {
Inputs ControlInput
}
func (*ControlledComponent) TypeID ¶
func (*ControlledComponent) TypeID() ecs.ComponentTypeID
type FollowCameraComponent ¶
type FollowCameraComponent struct { Target *game.Node AnchorPosition dprec.Vec3 AnchorDistance float64 CameraDistance float64 PitchAngle dprec.Angle YawAngle dprec.Angle Zoom float64 }
func (*FollowCameraComponent) TypeID ¶
func (*FollowCameraComponent) TypeID() ecs.ComponentTypeID
type FollowCameraSystem ¶
type FollowCameraSystem struct {
// contains filtered or unexported fields
}
func NewFollowCameraSystem ¶
func NewFollowCameraSystem(ecsScene *ecs.Scene, gamepadProvider GamepadProvider) *FollowCameraSystem
func (*FollowCameraSystem) OnKeyboardEvent ¶
func (s *FollowCameraSystem) OnKeyboardEvent(event ui.KeyboardEvent) bool
func (*FollowCameraSystem) Update ¶
func (s *FollowCameraSystem) Update(elapsedSeconds float64)
func (*FollowCameraSystem) UseDefaults ¶
func (s *FollowCameraSystem) UseDefaults()
type GamepadProvider ¶
type HubDefinition ¶
type HubDefinition struct {
// contains filtered or unexported fields
}
func NewHubDefinition ¶
func NewHubDefinition() *HubDefinition
func (*HubDefinition) WithBodyDefinition ¶
func (d *HubDefinition) WithBodyDefinition(def *physics.BodyDefinition) *HubDefinition
func (*HubDefinition) WithNodeName ¶
func (d *HubDefinition) WithNodeName(name string) *HubDefinition
type NodeComponent ¶
func (*NodeComponent) TypeID ¶
func (*NodeComponent) TypeID() ecs.ComponentTypeID
type Wheel ¶
type Wheel struct {
// contains filtered or unexported fields
}
func (*Wheel) AttachmentConstraint ¶
func (w *Wheel) AttachmentConstraint() *physics.DBConstraint
func (*Wheel) DirectionSolver ¶
func (w *Wheel) DirectionSolver() *constraint.MatchDirections
type WheelDefinition ¶
type WheelDefinition struct {
// contains filtered or unexported fields
}
func NewWheelDefinition ¶
func NewWheelDefinition() *WheelDefinition
func (*WheelDefinition) WithBodyDefinition ¶
func (d *WheelDefinition) WithBodyDefinition(def *physics.BodyDefinition) *WheelDefinition
func (*WheelDefinition) WithNodeName ¶
func (d *WheelDefinition) WithNodeName(name string) *WheelDefinition
type YawPitchCameraComponent ¶
func (*YawPitchCameraComponent) TypeID ¶
func (*YawPitchCameraComponent) TypeID() ecs.ComponentTypeID
type YawPitchCameraSystem ¶
type YawPitchCameraSystem struct {
// contains filtered or unexported fields
}
func NewYawPitchCameraSystem ¶
func NewYawPitchCameraSystem(ecsScene *ecs.Scene, gamepadProvider GamepadProvider) *YawPitchCameraSystem
func (*YawPitchCameraSystem) OnKeyboardEvent ¶
func (s *YawPitchCameraSystem) OnKeyboardEvent(event ui.KeyboardEvent) bool
func (*YawPitchCameraSystem) Update ¶
func (s *YawPitchCameraSystem) Update(elapsedSeconds float64)
func (*YawPitchCameraSystem) UseDefaults ¶
func (s *YawPitchCameraSystem) UseDefaults()
Click to show internal directories.
Click to hide internal directories.