Skip to content

Instantly share code, notes, and snippets.

View flushpot1125's full-sized avatar

Limes2018 flushpot1125

View GitHub Profile
%%変更前
\newcommand{\small}{%
\ifnarrowbaselines
\jsc@setfontsize\small\@ixpt{11}%
\else
\jsc@setfontsize\small\@ixpt{13}%
\fi
%%変更後
\newcommand{\small}{%
%%変更前
%% サンプルコードをさらに小さく
\renewenvironment{reviewemlist}{%
\medskip\footnotesize\begin{shaded}\ifdefined\reviewlistxkanjiskip\xkanjiskip=\reviewlistxkanjiskip\fi\setlength{\baselineskip}{1.2zw}\begin{alltt}}{%
\end{alltt}\end{shaded}}
\renewenvironment{reviewlist}{%
\begin{shaded}\footnotesize\ifdefined\reviewlistxkanjiskip\xkanjiskip=\reviewlistxkanjiskip\fi\setlength{\baselineskip}{1.2zw}\begin{alltt}}{%
\end{alltt}\end{shaded}\par\vspace*{0.5zw}}
% 変更前
\newcommand{\footnotesize}{%
\ifnarrowbaselines
\jsc@setfontsize\footnotesize\@viiipt{9.5}%
\else
\jsc@setfontsize\footnotesize\@viiipt{11}%
\fi
% 変更後
\newcommand{\footnotesize}{%
const xrHelper = await scene.createDefaultXRExperienceAsync({
floorMeshes: [environment.ground],
teleportationOptions: {
timeToTeleport :1000,
}
});
func _integrate_forces(state):
var delta = state.get_step()
var lv = state.get_linear_velocity()
var g = state.get_total_gravity()
# get_total_gravity returns zero for the first few frames, leading to errors.
if g == Vector3.ZERO:
g = gravity
lv += g * delta # Apply gravity.
var up = -g.normalized()
for(var n=0;n<character_parts.length;n++){
mirrorMaterial.reflectionTexture.renderList.push(character_parts[n]);
}
BABYLON.SceneLoader.ImportMesh("", "https://assets.babylonjs.com/meshes/", "HVGirl.glb", scene, function (newMeshes, particleSystems, skeletons, animationGroups) {
var hero = newMeshes[0];
//Scale the model down
hero.scaling.scaleInPlace(0.1);
//Lock camera on the character
camera.target = hero;
//Get the Samba animation Group
const sambaAnim = scene.getAnimationGroupByName("Samba");
//Create reflecting surface for mirror surface
var reflector = new BABYLON.Plane.FromPositionAndNormal(glass.position, glassNormal.scale(-1));
//Create the mirror material
var mirrorMaterial = new BABYLON.StandardMaterial("mirror", scene);
mirrorMaterial.reflectionTexture = new BABYLON.MirrorTexture("mirror", 1024, scene, true);
mirrorMaterial.reflectionTexture.mirrorPlane = reflector;
// Create behaviors to drag and scale with pointers in VR
var sixDofDragBehavior = new BABYLON.SixDofDragBehavior()
boundingBox.addBehavior(sixDofDragBehavior)
var multiPointerScaleBehavior = new BABYLON.MultiPointerScaleBehavior()
boundingBox.addBehavior(multiPointerScaleBehavior)
// wrap in bounding box mesh to avoid picking perf hit
var gltfMesh = container.meshes[0]
var boundingBox = BABYLON.BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(gltfMesh)
// Create bounding box gizmo
var utilLayer = new BABYLON.UtilityLayerRenderer(scene)
utilLayer.utilityLayerScene.autoClearDepthAndStencil = false;
var gizmo = new BABYLON.BoundingBoxGizmo(BABYLON.Color3.FromHexString("#0984e3"), utilLayer)
gizmo.attachedMesh = boundingBox;