Documentation
¶
Index ¶
- Constants
- type AvatarParamConfig
- type AxesLookDirection
- type AxesMoveDirection
- type Client
- func (c *Client) Chat(s string, b, n bool) error
- func (c *Client) ComfortLook(direction ComfortLookDirection, b bool) error
- func (c *Client) DropHand(hand DropHand, b bool) error
- func (c *Client) GrabHand(hand GrabHand, b bool) error
- func (c *Client) Jump() error
- func (c *Client) Look(direction LookDirection, b bool) error
- func (c *Client) Move(direction MoveDirection, b bool) error
- func (c *Client) PanicButton(b bool) error
- func (c *Client) ReadAvatarParamConfig(avatarId, userId string, path string) (AvatarParamConfig, error)
- func (c *Client) Run(b bool) error
- func (c *Client) SendMessage(address string, value ...interface{}) error
- func (c *Client) UseHand(hand UseHand, b bool) error
- func (c *Client) Voice() error
- type ComfortLookDirection
- type DropHand
- type GrabHand
- type InputConfig
- type LookDirection
- type MoveDirection
- type OutputConfig
- type ParameterConfig
- type UseHand
Constants ¶
const ( DefaultAddr = "127.0.0.1" DefaultPort = 9000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarParamConfig ¶
type AvatarParamConfig struct {
ID string `json:"id"`
Name string `json:"name"`
Parameters []ParameterConfig `json:"parameters"`
}
type AxesLookDirection ¶
type AxesLookDirection string
const ( AxisLookLeft AxesLookDirection = "LookHorizontal" AxisLookRight AxesLookDirection = "LookVertical" )
type AxesMoveDirection ¶
type AxesMoveDirection string
const ( AxisVertical AxesMoveDirection = "Vertical" AxisHorizontal AxesMoveDirection = "Horizontal" )
type Client ¶
func NewOscClient ¶
Initiates an OSC client Default address is localhost (127.0.0.1), Default port is 9000
func (*Client) Chat ¶
Chat is a function that sends a message into the VRChat text chat. If b is True, send the text in s immediately, bypassing the keyboard. If b is False, open the keyboard and populate it with the provided text. n is an additional bool parameter that when set to False will not trigger the notification SFX (defaults to True if not specified).
func (*Client) ComfortLook ¶
func (c *Client) ComfortLook(direction ComfortLookDirection, b bool) error
ComfortLook works the same as Look, but for comfort turning using snap turns. VR Only.
func (*Client) DropHand ¶
DropHand drops the item in the hand of the specified side. It takes a DropHand and a boolean value as parameters. The boolean value indicates whether to enable or disable the drop hand action. VR Only.
func (*Client) GrabHand ¶
GrabHand grabs the item in the hand of the specified side. It takes a GrabHand and a boolean value as parameters. The boolean value indicates whether to enable or disable the grab hand action. VR Only.
func (*Client) Look ¶
func (c *Client) Look(direction LookDirection, b bool) error
Look sends an OSC message to control the look direction. It takes a LookDirection and a boolean value as parameters. The boolean value indicates whether to enable or disable the look direction. It returns an error if there was a problem sending the message.
func (*Client) Move ¶
func (c *Client) Move(direction MoveDirection, b bool) error
Move sends a move direction and a boolean value to the OSC server. It takes a MoveDirection and a boolean value as parameters. The boolean value indicates whether to enable or disable the move direction. It returns an error if there was a problem sending the message.
func (*Client) ReadAvatarParamConfig ¶
func (c *Client) ReadAvatarParamConfig(avatarId, userId string, path string) (AvatarParamConfig, error)
ReadAvatarParamConfig reads the avatar parameter configuration from the specified file. The returned struct should be used in conjunction with the client.SendMessage function to send messages to the VRChat avatar parameters. The `path` can be specified to read from a custom location. If `path` is empty, it will default to the standard VRChat path based on the operating system. It should point to ~/AppData/LocalLow/VRChat/VRChat/OSC/
func (*Client) SendMessage ¶
SendMessage is a helper function that sends an OSC message to VRChat.
type ComfortLookDirection ¶
type ComfortLookDirection string
const ( ComfortLookLeft ComfortLookDirection = "ComfortLeft" ComfortLookRight ComfortLookDirection = "ComfortRight" )
type InputConfig ¶
type InputConfig struct {
Address string `json:"address"`
Type string `json:"type"`
// contains filtered or unexported fields
}
func (*InputConfig) Send ¶
func (i *InputConfig) Send(value ...interface{}) error
type LookDirection ¶
type LookDirection string
const ( LookLeft LookDirection = "LookLeft" LookRight LookDirection = "LookRight" )
type MoveDirection ¶
type MoveDirection string
const ( MoveForward MoveDirection = "MoveForward" MoveBackward MoveDirection = "MoveBackward" MoveLeft MoveDirection = "MoveLeft" MoveRight MoveDirection = "MoveRight" )
type OutputConfig ¶
type ParameterConfig ¶
type ParameterConfig struct {
Name string `json:"name"`
Input InputConfig `json:"input,omitempty"`
Output OutputConfig `json:"output"`
}