This file contains hidden or 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
@component | |
export class LeaderboardExample extends BaseScriptComponent { | |
@input | |
leaderboardModule: LeaderboardModule; | |
@input | |
textLogs: Text; | |
private leaderboardInstance: any; | |
private leaderboardName = 'EXAMPLE_LEADERBOARD'; |
This file contains hidden or 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 bypasses the interactable system | |
let me know what you think | |
remember that you need to set up the ray start and end | |
you can create 2 scene objects and put them under the main camera | |
1. at 0,0,0 | |
2. at 0,0,-100 (forward) | |
then assign a 3rd object that is the one that is instantiated on the hitPoint of the raycast | |
remember that the geometry receiving the raycast needs to have a collider and a physics body | |
if you want the receiver to not be dynamic uncheck the dynamic option so it won' react to physics |
This file contains hidden or 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
// Import required modules | |
const WorldQueryModule = require("LensStudio:WorldQueryModule"); | |
const EPSILON = 0.01; | |
/** | |
* DirectionalWorldQuery | |
* | |
* A utility that performs world queries in a direction defined by two scene objects. | |
* It can then project rays from a third object in that same direction. |
This file contains hidden or 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
/** | |
* Imports required dependencies for map functionality, quest markers, and camera handling | |
*/ | |
import { MapComponent } from "../MapComponent/Scripts/MapComponent"; | |
import { MapPin } from "../MapComponent/Scripts/MapPin"; | |
import { | |
calculateBearing, | |
customGetEuler, | |
getPhysicalDistanceBetweenLocations, | |
map, |
This file contains hidden or 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
import { LSTween } from "../../LSTween"; | |
import Easing from "../../TweenJS/Easing"; | |
import { RotationInterpolationType } from "../../RotationInterpolationType"; | |
@component | |
export class Example_PrefabInstantiateTween extends BaseScriptComponent { | |
@input prefab: ObjectPrefab = null; | |
@input minRotation: vec3 = new vec3(-45, -45, -45); | |
@input maxRotation: vec3 = new vec3(45, 45, 45); | |
@input minScale: vec3 = new vec3(0.5, 0.5, 0.5); |
This file contains hidden or 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
import { Interactable } from "SpectaclesInteractionKit/Components/Interaction/Interactable/Interactable"; | |
import { InteractorEvent } from "SpectaclesInteractionKit/Core/Interactor/InteractorEvent"; | |
import { SIK } from "SpectaclesInteractionKit/SIK"; | |
import { mix } from "SpectaclesInteractionKit/Utils/animate"; | |
import NativeLogger from "SpectaclesInteractionKit/Utils/NativeLogger"; | |
const log = new NativeLogger("MyNativeLogger"); | |
// Interaction System https://developers.snap.com/spectacles/spectacles-frameworks/spectacles-interaction-kit/features/interactionsystem | |
// Instantiate https://developers.snap.com/lens-studio/api/lens-scripting/classes/Built-In.ObjectPrefab.html#instantiateasync or https://developers.snap.com/lens-studio/lens-studio-workflow/prefabs |
This file contains hidden or 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
//@input Component.ScriptComponent speechRecognitionScript {"label": "Speech Recognition Script"} | |
//@input float switchInterval = 10.0 {"label": "Switch Interval (seconds)"} | |
var languages = [ | |
"LANGUAGE_ENGLISH", | |
"LANGUAGE_SPANISH", | |
"LANGUAGE_FRENCH", | |
"LANGUAGE_GERMAN" | |
]; | |
var currentLanguageIndex = 0; |
This file contains hidden or 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
import NativeLogger from "SpectaclesInteractionKit/Utils/NativeLogger"; | |
const log = new NativeLogger("CameraAPIBothLogger"); | |
@component | |
export class CameraDoubleye extends BaseScriptComponent { | |
private cameraModule: CameraModule = require("LensStudio:CameraModule"); | |
private cameraRequestLeft: CameraModule.CameraRequest | undefined; | |
private cameraTextureLeft: Texture | undefined; | |
private cameraTextureProviderLeft: CameraTextureProvider | undefined; |