// Copyright 2024 drey7925 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package perovskite.protocol.entities; import "coordinates.proto"; import "render.proto"; message EntityMove { // The starting position for the movement perovskite.protocol.coordinates.Vec3D start_position = 1; // The initial velocity of the movement perovskite.protocol.coordinates.Vec3F velocity = 2; // The acceleration of the movement perovskite.protocol.coordinates.Vec3F acceleration = 3; reserved 4; // The face direction (about the vertical Y axis) in radians. 0 means facing +z float face_direction = 5; // The pitch up/down in radians. Positive means pitch up float pitch = 9; // The sequence number of the move. uint64 sequence = 6; // The total time scheduled for the movement, nanosecond ticks uint64 time_ticks = 7; // The tick on which the move is scheduled to start // This is synchronized with the timebase used for ticks in every stream message uint64 start_tick = 8; } message EntityUpdate { // The unique ID of the entity. uint64 id = 1; // The moves that are queued for this move, and have not yet been delivered to // this client repeated EntityMove planned_move = 2; reserved 3, 4; // If true, the entity should stop being displayed. If so, ignore all other // fields bool remove = 5; // todo later - appearance, including the ability to change the appearance on // demand // The entity's class, controlling its appearance uint32 entity_class = 6; // Entities trailing behind this entity. Note that these have less functionality; // they essentially just follow behind it, while the location of the primary entity // is used for things like collision detection, proximity queries, etc. The exact // set of limitations is still TBD repeated TrailingEntity trailing_entity = 7; } // Secondary entities that trail behind the main entity at fixed distance, e.g. // ducklings following a duck, or minecarts coupled into a train. message TrailingEntity { uint32 class = 1; float distance = 2; } message EntityTypeAssignment { string short_name = 1; uint32 entity_class = 2; } message ServerEntityTypeAssignments { repeated EntityTypeAssignment entity_type = 1; } message EntityDef { string short_name = 1; uint32 entity_class = 2; EntityAppearance appearance = 3; } message EntityAppearance { // The mesh to use for the entity. At least one must be specified. repeated perovskite.protocol.render.CustomMesh custom_mesh = 1; // The offset to move the player position when attached to this entity. perovskite.protocol.coordinates.Vec3D attachment_offset = 2; // If true, the attachment offset is given in model space and will be transformed // subject to the angle of the entity. If false, the attachment offset is given // in world space and undergoes no transformation bool attachment_offset_in_model_space = 3; }