MRTK eye tracking layer mask - hololens

I want to prevent the eye tracking ray from seeing some objects, how can I do that?
This object must contain a collider and must be interactable. So I can't delete the collider component.
I think I can solve the problem by editing the layermask property of the pointer that belongs to eye tracking, but I couldn't find how to do it.

You can create a new layer named "Ignore Raycast" and assign the layer to the GameObjects which block the ray. And then, make sure the Ignore Raycast layer has been unchecked in the array of LayerMask under the Pointing Raycast Layer Masks property in the Pointer profile.
For more information about Unity Layer please see: Layer

Related

How to make a custom collider that will deform with a skeleton in Godot

I would like to make a collision detector for a mesh I have imported from blender. The mesh is parented to a skeleton, which I use to deform the mesh. I would like to attach a collider to it in order to implement physics. Instead of attaching a general shape collider like a cube or sphere to the mesh, I want it to be an accurate copy of the mesh itself. I've tried adding a Trimesh Static Body, which does make a collider the same shape as the mesh, however since it's static, it won't deform with a skeleton. Is there a way to generate a collider the same shape as a mesh that would deform with a skeleton and also stay with the mesh as it moves around?
You can make a collider the same shape as a skeleton / mesh that is deformed by a skeleton by using the BoneAttachement node, which is a subcategory of the Spatial class. By using this node, you can attach a primitive shape collider to each bone in your skeleton. This will result in a mostly accurate collider shape made up of many smaller colliders that will deform and stay with the skeleton.
Step 1:
Add a BoneAttachment node as a child of the Skeleton node in your model. Set the bone name property to whatever bone you would like the collision shape to follow. After this is done, any nodes parented to this BoneAttachment node will copy the transform of the bone which it is set to.
Step 2:
Add either a KinematicBody or an Area node as a child of the BoneAttachment node. Don't add a RigidBody, because they're meant to be controlled by physics only, so this won't work if you add it.
If you add a KinematicBody node, your collider won't be affected by physics, but other objects like a RigidBody will still collide and bounce off of it.
If you add an Area node, your collider won't directly affect any physics objects that come into contact with it (objects will pass right through it), but you can write a script that will cause some effect to happen when objects contact it. For example, you could make it so that when an object enters the area, a force is applied to it and it gets pushed away.
Step 3:
Add a CollisionShape node as a child of whatever PhysicsBody you chose in the last step. Choose the shape and configure its transform so it copies the shape of the part of the mesh you are working on. Then, repeat these steps for each bone of the skeleton until you have an accurately shaped collider.

Clear all Layers with vkCmdBeginRenderPass (Vulkan, Layered rendering)

I have a framebuffer with one color attachment, which is a cube map with 6 layers. I try to use layered rendering with the geometry shader. Rendering of a simple triangle to all layers works. But I am not sure how to clear all layers with vkCmdBeginRenderPass.
vkCmdBeginRenderPass supports pClearValues and clearValueCount but I can not specify the number of layers. So only the first layer is cleared. Setting clearValueCount to 6 and giving 6 clear values also does not help.
I saw that vkCmdClearAttachments seems to allow to specify the layers.
Is vkCmdClearAttachments the only way, or did I miss something? Is there maybe a reason that vkCmdBeginRenderPass only clears the first layer although rendering seems to render to all layers?
clearValueCount refers to the number of attachments to clear (with regards to their clearOp), not the layers of a framebuffer.
The number of layers to be cleared at the start of a renderpass (if clearOp is set to clear) for a framebuffer is specified via the layerCount of it's imageView's subresource.

Pygame sprites always on top example?

I was wondering if someone could give me simple example of how to always draw sprites in pygame on --the top layer-- whilst an animation is being blitted on screen?
The senario I'm trying to solve is having an animated sprite (eg a man walking on the spot) and various other objects passing him, whilst he is still animated.
My solution so far has the animation layering on top of the "passing objects" which is not what I want.
Thanks in advance.
I think you've partially answered your own question here.
It's a matter of organizing what gets drawn first. Some side-scrolling 2D games use a "layer" solution, in which there is a background layer, a middleground layer, and a foreground layer, and the drawing system renders one layer after another.
I've also seen Pokémon top-down style games simply sort the sprites by their vertical position, so sprites "nearest" to the camera are drawn last, and thus on top of the other sprites.
See how the current implementation of Scene2D in libGDX gives each Actor a z-index property which can later be used to organize Actors into layers.
Just draw your sprites with a LayeredUpdates group:
class pygame.sprite.LayeredUpdates
LayeredUpdates is a sprite group that handles layers and draws like OrderedUpdates.
LayeredUpdates(*spites, **kwargs) -> LayeredUpdates
You can set the default layer through kwargs using ‘default_layer’ and an integer for the layer. The default layer is 0.
If the sprite you add has an attribute layer then that layer will be used. If the **kwarg contains ‘layer’ then the sprites passed will be added to that layer (overriding the sprite.layer attribute). If neither sprite has attribute layer nor **kwarg then the default layer is used to add the sprites.
and give your sprites the correct layer value.

Nutiteq set layer level or height

i have a map application. In my map, there is two layer which i use. First layer shows traffic lines, second layer shows my route. In this point when i draw route somewhere, my route lines remain below the traffic lines. So i want to set height or level my route layer. It have to allways top of traffic lines.
I try to set z point of my mappos but it couldn't. Is there another way to set height my layer?
MapPos mapPos = new MapPos(longitudeValue, latitudeValue, 1);
Drawing order is determined by adding order of Layers, so you should use different layers for traffic and route, and add traffic Layer before route Layer. Within single Layer the order of objects is not determined.
Z value is not in use in current version, this is meant for 3D cases, like display of pipelines below ground, or airways above ground. However, the public version does not render basic vector objects in 3D, only 3D models are supported.

rajawali and vuforia 3d model positioning

I have followed the RajawaliVuforia tutorial and integrated the rajawali with vuforia CloudReco and i am able to get the 3D model but model is not positioned properly in target image center and also if i move camera close or up, the model is positioning out of the target image. Can someone let me know what could be the issue.
Vuforia passes the position (Vector3) and orientation (Quaternion) to Rajawali. Rajawali then uses this to position and rotate the model. This might interfere with animations applied to the model. If you're using animations or if you're setting the position manually you'll get unpredictable results. The reason for this is that the position is set twice on each frame.
The way to fix this is to put your 3D model in a container (an empty BaseObject3D). Vuforia's position and orientation will be applied to this container and not your 3D model. This way you can animate the model without getting unpredictable results.

Resources