1#![allow(unknown_lints)]
7#![allow(clippy::all)]
8
9#![allow(unused_attributes)]
10#![cfg_attr(rustfmt, rustfmt::skip)]
11
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_results)]
19#![allow(unused_mut)]
20
21const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
26
27#[derive(::gz_msgs_common::IgnMessage)]
28#[derive(PartialEq,Clone,Default,Debug)]
30pub struct Light {
31 pub header: ::protobuf::MessageField<super::header::Header>,
34 pub name: ::std::string::String,
36 pub type_: ::protobuf::EnumOrUnknown<light::LightType>,
38 pub pose: ::protobuf::MessageField<super::pose::Pose>,
40 pub diffuse: ::protobuf::MessageField<super::color::Color>,
42 pub specular: ::protobuf::MessageField<super::color::Color>,
44 pub attenuation_constant: f32,
46 pub attenuation_linear: f32,
48 pub attenuation_quadratic: f32,
50 pub direction: ::protobuf::MessageField<super::vector3d::Vector3d>,
52 pub range: f32,
54 pub cast_shadows: bool,
56 pub spot_inner_angle: f32,
58 pub spot_outer_angle: f32,
60 pub spot_falloff: f32,
62 pub id: u32,
64 pub parent_id: u32,
66 pub intensity: f32,
68 pub special_fields: ::protobuf::SpecialFields,
71}
72
73impl<'a> ::std::default::Default for &'a Light {
74 fn default() -> &'a Light {
75 <Light as ::protobuf::Message>::default_instance()
76 }
77}
78
79impl Light {
80 pub fn new() -> Light {
81 ::std::default::Default::default()
82 }
83
84 fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
85 let mut fields = ::std::vec::Vec::with_capacity(18);
86 let mut oneofs = ::std::vec::Vec::with_capacity(0);
87 fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::header::Header>(
88 "header",
89 |m: &Light| { &m.header },
90 |m: &mut Light| { &mut m.header },
91 ));
92 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
93 "name",
94 |m: &Light| { &m.name },
95 |m: &mut Light| { &mut m.name },
96 ));
97 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
98 "type",
99 |m: &Light| { &m.type_ },
100 |m: &mut Light| { &mut m.type_ },
101 ));
102 fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pose::Pose>(
103 "pose",
104 |m: &Light| { &m.pose },
105 |m: &mut Light| { &mut m.pose },
106 ));
107 fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::color::Color>(
108 "diffuse",
109 |m: &Light| { &m.diffuse },
110 |m: &mut Light| { &mut m.diffuse },
111 ));
112 fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::color::Color>(
113 "specular",
114 |m: &Light| { &m.specular },
115 |m: &mut Light| { &mut m.specular },
116 ));
117 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
118 "attenuation_constant",
119 |m: &Light| { &m.attenuation_constant },
120 |m: &mut Light| { &mut m.attenuation_constant },
121 ));
122 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
123 "attenuation_linear",
124 |m: &Light| { &m.attenuation_linear },
125 |m: &mut Light| { &mut m.attenuation_linear },
126 ));
127 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
128 "attenuation_quadratic",
129 |m: &Light| { &m.attenuation_quadratic },
130 |m: &mut Light| { &mut m.attenuation_quadratic },
131 ));
132 fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::vector3d::Vector3d>(
133 "direction",
134 |m: &Light| { &m.direction },
135 |m: &mut Light| { &mut m.direction },
136 ));
137 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
138 "range",
139 |m: &Light| { &m.range },
140 |m: &mut Light| { &mut m.range },
141 ));
142 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
143 "cast_shadows",
144 |m: &Light| { &m.cast_shadows },
145 |m: &mut Light| { &mut m.cast_shadows },
146 ));
147 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
148 "spot_inner_angle",
149 |m: &Light| { &m.spot_inner_angle },
150 |m: &mut Light| { &mut m.spot_inner_angle },
151 ));
152 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
153 "spot_outer_angle",
154 |m: &Light| { &m.spot_outer_angle },
155 |m: &mut Light| { &mut m.spot_outer_angle },
156 ));
157 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
158 "spot_falloff",
159 |m: &Light| { &m.spot_falloff },
160 |m: &mut Light| { &mut m.spot_falloff },
161 ));
162 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
163 "id",
164 |m: &Light| { &m.id },
165 |m: &mut Light| { &mut m.id },
166 ));
167 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
168 "parent_id",
169 |m: &Light| { &m.parent_id },
170 |m: &mut Light| { &mut m.parent_id },
171 ));
172 fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
173 "intensity",
174 |m: &Light| { &m.intensity },
175 |m: &mut Light| { &mut m.intensity },
176 ));
177 ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Light>(
178 "Light",
179 fields,
180 oneofs,
181 )
182 }
183}
184
185impl ::protobuf::Message for Light {
186 const NAME: &'static str = "Light";
187
188 fn is_initialized(&self) -> bool {
189 true
190 }
191
192 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
193 while let Some(tag) = is.read_raw_tag_or_eof()? {
194 match tag {
195 10 => {
196 ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
197 },
198 18 => {
199 self.name = is.read_string()?;
200 },
201 24 => {
202 self.type_ = is.read_enum_or_unknown()?;
203 },
204 34 => {
205 ::protobuf::rt::read_singular_message_into_field(is, &mut self.pose)?;
206 },
207 42 => {
208 ::protobuf::rt::read_singular_message_into_field(is, &mut self.diffuse)?;
209 },
210 50 => {
211 ::protobuf::rt::read_singular_message_into_field(is, &mut self.specular)?;
212 },
213 61 => {
214 self.attenuation_constant = is.read_float()?;
215 },
216 69 => {
217 self.attenuation_linear = is.read_float()?;
218 },
219 77 => {
220 self.attenuation_quadratic = is.read_float()?;
221 },
222 82 => {
223 ::protobuf::rt::read_singular_message_into_field(is, &mut self.direction)?;
224 },
225 93 => {
226 self.range = is.read_float()?;
227 },
228 96 => {
229 self.cast_shadows = is.read_bool()?;
230 },
231 109 => {
232 self.spot_inner_angle = is.read_float()?;
233 },
234 117 => {
235 self.spot_outer_angle = is.read_float()?;
236 },
237 125 => {
238 self.spot_falloff = is.read_float()?;
239 },
240 128 => {
241 self.id = is.read_uint32()?;
242 },
243 136 => {
244 self.parent_id = is.read_uint32()?;
245 },
246 149 => {
247 self.intensity = is.read_float()?;
248 },
249 tag => {
250 ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
251 },
252 };
253 }
254 ::std::result::Result::Ok(())
255 }
256
257 #[allow(unused_variables)]
259 fn compute_size(&self) -> u64 {
260 let mut my_size = 0;
261 if let Some(v) = self.header.as_ref() {
262 let len = v.compute_size();
263 my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
264 }
265 if !self.name.is_empty() {
266 my_size += ::protobuf::rt::string_size(2, &self.name);
267 }
268 if self.type_ != ::protobuf::EnumOrUnknown::new(light::LightType::POINT) {
269 my_size += ::protobuf::rt::int32_size(3, self.type_.value());
270 }
271 if let Some(v) = self.pose.as_ref() {
272 let len = v.compute_size();
273 my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
274 }
275 if let Some(v) = self.diffuse.as_ref() {
276 let len = v.compute_size();
277 my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
278 }
279 if let Some(v) = self.specular.as_ref() {
280 let len = v.compute_size();
281 my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
282 }
283 if self.attenuation_constant != 0. {
284 my_size += 1 + 4;
285 }
286 if self.attenuation_linear != 0. {
287 my_size += 1 + 4;
288 }
289 if self.attenuation_quadratic != 0. {
290 my_size += 1 + 4;
291 }
292 if let Some(v) = self.direction.as_ref() {
293 let len = v.compute_size();
294 my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
295 }
296 if self.range != 0. {
297 my_size += 1 + 4;
298 }
299 if self.cast_shadows != false {
300 my_size += 1 + 1;
301 }
302 if self.spot_inner_angle != 0. {
303 my_size += 1 + 4;
304 }
305 if self.spot_outer_angle != 0. {
306 my_size += 1 + 4;
307 }
308 if self.spot_falloff != 0. {
309 my_size += 1 + 4;
310 }
311 if self.id != 0 {
312 my_size += ::protobuf::rt::uint32_size(16, self.id);
313 }
314 if self.parent_id != 0 {
315 my_size += ::protobuf::rt::uint32_size(17, self.parent_id);
316 }
317 if self.intensity != 0. {
318 my_size += 2 + 4;
319 }
320 my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
321 self.special_fields.cached_size().set(my_size as u32);
322 my_size
323 }
324
325 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
326 if let Some(v) = self.header.as_ref() {
327 ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
328 }
329 if !self.name.is_empty() {
330 os.write_string(2, &self.name)?;
331 }
332 if self.type_ != ::protobuf::EnumOrUnknown::new(light::LightType::POINT) {
333 os.write_enum(3, ::protobuf::EnumOrUnknown::value(&self.type_))?;
334 }
335 if let Some(v) = self.pose.as_ref() {
336 ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
337 }
338 if let Some(v) = self.diffuse.as_ref() {
339 ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
340 }
341 if let Some(v) = self.specular.as_ref() {
342 ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
343 }
344 if self.attenuation_constant != 0. {
345 os.write_float(7, self.attenuation_constant)?;
346 }
347 if self.attenuation_linear != 0. {
348 os.write_float(8, self.attenuation_linear)?;
349 }
350 if self.attenuation_quadratic != 0. {
351 os.write_float(9, self.attenuation_quadratic)?;
352 }
353 if let Some(v) = self.direction.as_ref() {
354 ::protobuf::rt::write_message_field_with_cached_size(10, v, os)?;
355 }
356 if self.range != 0. {
357 os.write_float(11, self.range)?;
358 }
359 if self.cast_shadows != false {
360 os.write_bool(12, self.cast_shadows)?;
361 }
362 if self.spot_inner_angle != 0. {
363 os.write_float(13, self.spot_inner_angle)?;
364 }
365 if self.spot_outer_angle != 0. {
366 os.write_float(14, self.spot_outer_angle)?;
367 }
368 if self.spot_falloff != 0. {
369 os.write_float(15, self.spot_falloff)?;
370 }
371 if self.id != 0 {
372 os.write_uint32(16, self.id)?;
373 }
374 if self.parent_id != 0 {
375 os.write_uint32(17, self.parent_id)?;
376 }
377 if self.intensity != 0. {
378 os.write_float(18, self.intensity)?;
379 }
380 os.write_unknown_fields(self.special_fields.unknown_fields())?;
381 ::std::result::Result::Ok(())
382 }
383
384 fn special_fields(&self) -> &::protobuf::SpecialFields {
385 &self.special_fields
386 }
387
388 fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
389 &mut self.special_fields
390 }
391
392 fn new() -> Light {
393 Light::new()
394 }
395
396 fn clear(&mut self) {
397 self.header.clear();
398 self.name.clear();
399 self.type_ = ::protobuf::EnumOrUnknown::new(light::LightType::POINT);
400 self.pose.clear();
401 self.diffuse.clear();
402 self.specular.clear();
403 self.attenuation_constant = 0.;
404 self.attenuation_linear = 0.;
405 self.attenuation_quadratic = 0.;
406 self.direction.clear();
407 self.range = 0.;
408 self.cast_shadows = false;
409 self.spot_inner_angle = 0.;
410 self.spot_outer_angle = 0.;
411 self.spot_falloff = 0.;
412 self.id = 0;
413 self.parent_id = 0;
414 self.intensity = 0.;
415 self.special_fields.clear();
416 }
417
418 fn default_instance() -> &'static Light {
419 static instance: Light = Light {
420 header: ::protobuf::MessageField::none(),
421 name: ::std::string::String::new(),
422 type_: ::protobuf::EnumOrUnknown::from_i32(0),
423 pose: ::protobuf::MessageField::none(),
424 diffuse: ::protobuf::MessageField::none(),
425 specular: ::protobuf::MessageField::none(),
426 attenuation_constant: 0.,
427 attenuation_linear: 0.,
428 attenuation_quadratic: 0.,
429 direction: ::protobuf::MessageField::none(),
430 range: 0.,
431 cast_shadows: false,
432 spot_inner_angle: 0.,
433 spot_outer_angle: 0.,
434 spot_falloff: 0.,
435 id: 0,
436 parent_id: 0,
437 intensity: 0.,
438 special_fields: ::protobuf::SpecialFields::new(),
439 };
440 &instance
441 }
442}
443
444impl ::protobuf::MessageFull for Light {
445 fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
446 static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
447 descriptor.get(|| file_descriptor().message_by_package_relative_name("Light").unwrap()).clone()
448 }
449}
450
451impl ::std::fmt::Display for Light {
452 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
453 ::protobuf::text_format::fmt(self, f)
454 }
455}
456
457impl ::protobuf::reflect::ProtobufValue for Light {
458 type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
459}
460
461pub mod light {
463 #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
464 pub enum LightType {
466 POINT = 0,
468 SPOT = 1,
470 DIRECTIONAL = 2,
472 }
473
474 impl ::protobuf::Enum for LightType {
475 const NAME: &'static str = "LightType";
476
477 fn value(&self) -> i32 {
478 *self as i32
479 }
480
481 fn from_i32(value: i32) -> ::std::option::Option<LightType> {
482 match value {
483 0 => ::std::option::Option::Some(LightType::POINT),
484 1 => ::std::option::Option::Some(LightType::SPOT),
485 2 => ::std::option::Option::Some(LightType::DIRECTIONAL),
486 _ => ::std::option::Option::None
487 }
488 }
489
490 fn from_str(str: &str) -> ::std::option::Option<LightType> {
491 match str {
492 "POINT" => ::std::option::Option::Some(LightType::POINT),
493 "SPOT" => ::std::option::Option::Some(LightType::SPOT),
494 "DIRECTIONAL" => ::std::option::Option::Some(LightType::DIRECTIONAL),
495 _ => ::std::option::Option::None
496 }
497 }
498
499 const VALUES: &'static [LightType] = &[
500 LightType::POINT,
501 LightType::SPOT,
502 LightType::DIRECTIONAL,
503 ];
504 }
505
506 impl ::protobuf::EnumFull for LightType {
507 fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
508 static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
509 descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("Light.LightType").unwrap()).clone()
510 }
511
512 fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
513 let index = *self as usize;
514 Self::enum_descriptor().value_by_index(index)
515 }
516 }
517
518 impl ::std::default::Default for LightType {
519 fn default() -> Self {
520 LightType::POINT
521 }
522 }
523
524 impl LightType {
525 pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
526 ::protobuf::reflect::GeneratedEnumDescriptorData::new::<LightType>("Light.LightType")
527 }
528 }
529}
530
531static file_descriptor_proto_data: &'static [u8] = b"\
532 \n\x19ignition/msgs/light.proto\x12\rignition.msgs\x1a\x1aignition/msgs/\
533 header.proto\x1a\x18ignition/msgs/pose.proto\x1a\x1cignition/msgs/vector\
534 3d.proto\x1a\x19ignition/msgs/color.proto\"\x85\x06\n\x05Light\x12-\n\
535 \x06header\x18\x01\x20\x01(\x0b2\x15.ignition.msgs.HeaderR\x06header\x12\
536 \x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x122\n\x04type\x18\x03\x20\
537 \x01(\x0e2\x1e.ignition.msgs.Light.LightTypeR\x04type\x12'\n\x04pose\x18\
538 \x04\x20\x01(\x0b2\x13.ignition.msgs.PoseR\x04pose\x12.\n\x07diffuse\x18\
539 \x05\x20\x01(\x0b2\x14.ignition.msgs.ColorR\x07diffuse\x120\n\x08specula\
540 r\x18\x06\x20\x01(\x0b2\x14.ignition.msgs.ColorR\x08specular\x121\n\x14a\
541 ttenuation_constant\x18\x07\x20\x01(\x02R\x13attenuationConstant\x12-\n\
542 \x12attenuation_linear\x18\x08\x20\x01(\x02R\x11attenuationLinear\x123\n\
543 \x15attenuation_quadratic\x18\t\x20\x01(\x02R\x14attenuationQuadratic\
544 \x125\n\tdirection\x18\n\x20\x01(\x0b2\x17.ignition.msgs.Vector3dR\tdire\
545 ction\x12\x14\n\x05range\x18\x0b\x20\x01(\x02R\x05range\x12!\n\x0ccast_s\
546 hadows\x18\x0c\x20\x01(\x08R\x0bcastShadows\x12(\n\x10spot_inner_angle\
547 \x18\r\x20\x01(\x02R\x0espotInnerAngle\x12(\n\x10spot_outer_angle\x18\
548 \x0e\x20\x01(\x02R\x0espotOuterAngle\x12!\n\x0cspot_falloff\x18\x0f\x20\
549 \x01(\x02R\x0bspotFalloff\x12\x0e\n\x02id\x18\x10\x20\x01(\rR\x02id\x12\
550 \x1b\n\tparent_id\x18\x11\x20\x01(\rR\x08parentId\x12\x1c\n\tintensity\
551 \x18\x12\x20\x01(\x02R\tintensity\"1\n\tLightType\x12\t\n\x05POINT\x10\0\
552 \x12\x08\n\x04SPOT\x10\x01\x12\x0f\n\x0bDIRECTIONAL\x10\x02B\x20\n\x11co\
553 m.ignition.msgsB\x0bLightProtosb\x06proto3\
554";
555
556fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
558 static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
559 file_descriptor_proto_lazy.get(|| {
560 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
561 })
562}
563
564pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
566 static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
567 static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
568 file_descriptor.get(|| {
569 let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
570 let mut deps = ::std::vec::Vec::with_capacity(4);
571 deps.push(super::header::file_descriptor().clone());
572 deps.push(super::pose::file_descriptor().clone());
573 deps.push(super::vector3d::file_descriptor().clone());
574 deps.push(super::color::file_descriptor().clone());
575 let mut messages = ::std::vec::Vec::with_capacity(1);
576 messages.push(Light::generated_message_descriptor_data());
577 let mut enums = ::std::vec::Vec::with_capacity(1);
578 enums.push(light::LightType::generated_enum_descriptor_data());
579 ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
580 file_descriptor_proto(),
581 deps,
582 messages,
583 enums,
584 )
585 });
586 ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
587 })
588}