This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let ray = screen_to_world(cursor_position, &windows, camera, camera_transform); | |
let plane = HalfSpace::new(Unit::new_normalize(Vec3::Z.to_vector3())); | |
if let Some(toi) = plane.cast_local_ray(&ray, Real::MAX, false) { | |
dbg!(ray.point_at(toi)); // <-- would expect values the same as bevy's units, but is instead y-1. to y1, and x-1.7 to x1.7 (I think this specific # has to do with the aspect ratio) | |
} | |
// From https://github.com/aevyrie/bevy_mod_raycast/blob/8b2ee7d015b9bb886684d7ad7796e404944bd5dd/src/primitives.rs | |
// MIT License | |
// Gets a ray from our camera to our mouse position on screen | |
pub fn screen_to_world( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: pipeline | |
name: default | |
steps: | |
- name: doc | |
image: rustlang/rust:nightly | |
commands: | |
- apt update | |
- apt install libasound2-dev -y | |
- cargo doc --no-deps --document-private-items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_main] | |
#![no_std] | |
extern crate panic_semihosting; | |
extern crate stm32f1xx_hal as hal; | |
use cortex_m::singleton; | |
use rtic::app; | |
use rtic::cyccnt::U32Ext; | |
use stm32f1xx_hal::prelude::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_main] | |
#![no_std] | |
use stm32f1xx_hal as hal; | |
extern crate panic_semihosting; | |
use cortex_m_semihosting::hprintln; | |
use hal::{prelude::*, stm32, stm32::{Peripherals}, delay::Delay, timer::Timer}; | |
use ws2812_timer_delay as ws2812; | |
use smart_leds::{RGB8, brightness, SmartLedsWrite}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// response with items | |
{ | |
"response": { | |
"posts": [ "etc" ] | |
}, | |
} | |
// response without items | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_main] | |
#![no_std] | |
// set the panic handler | |
extern crate panic_semihosting; | |
pub mod midi; | |
use core::sync::atomic::{AtomicBool, Ordering}; | |
use cortex_m::{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2016 DSP Synthesizers Sweden. | |
Author: Jan Ostman | |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
See the GNU General Public License for more details. | |
*/ | |
#include "wiring.h" | |
#include "LPC8xx.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Default, Deserialize, Serialize, PrefabData)] | |
#[serde(default, deny_unknown_fields)] | |
#[prefab(Component)] | |
pub struct CharacterData { | |
/// The speed at which projectiles from a basic attack move | |
pub basic_attack_speed: f32, | |
/// The range at which the projectile dies | |
pub basic_attack_range: f32, | |
/// Whether or not the character wants to attack | |
pub attack: bool, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Pong Tutorial 2 | |
mod assets; | |
mod components; | |
mod data; | |
mod states; | |
mod systems; | |
use crate::systems as s; | |
use crate::assets::config::GameConfig; |
NewerOlder